|
3 | 3 | import Builtin
|
4 | 4 |
|
5 | 5 | sil @paable : $@convention(thin) (Builtin.Int64) -> ()
|
| 6 | +sil @moved_pai_callee : $@convention(thin) (@inout_aliasable Builtin.Int64) -> () |
6 | 7 |
|
7 | 8 | sil [ossa] [transparent] @partial_apply_on_stack_nesting_violator : $@convention(thin) <T> () -> () {
|
8 | 9 | %paable = function_ref @paable : $@convention(thin) (Builtin.Int64) -> ()
|
@@ -34,4 +35,23 @@ sil [no_locks] @test_inline_stack_violating_ossa_func : $@convention(thin) () ->
|
34 | 35 | return %retval : $()
|
35 | 36 | }
|
36 | 37 |
|
37 |
| - |
| 38 | +// CHECK-LABEL: sil hidden [no_allocation] [ossa] @moved_pai : {{.*}} { |
| 39 | +// CHECK-NOT: partial_apply |
| 40 | +// CHECK-LABEL: } // end sil function 'moved_pai' |
| 41 | +sil hidden [no_allocation] [ossa] @moved_pai : $@convention(thin) () -> Builtin.Int64 { |
| 42 | +bb0: |
| 43 | + %addr = alloc_stack $Builtin.Int64 |
| 44 | + %42 = integer_literal $Builtin.Int64, 42 |
| 45 | + store %42 to [trivial] %addr : $*Builtin.Int64 |
| 46 | + %callee = function_ref @moved_pai_callee : $@convention(thin) (@inout_aliasable Builtin.Int64) -> () |
| 47 | + %closure = partial_apply [callee_guaranteed] %callee(%addr) : $@convention(thin) (@inout_aliasable Builtin.Int64) -> () |
| 48 | + %closure_lifetime = move_value [lexical] %closure : $@callee_guaranteed () -> () |
| 49 | + debug_value %closure_lifetime : $@callee_guaranteed () -> () |
| 50 | + %copy = copy_value %closure_lifetime : $@callee_guaranteed () -> () |
| 51 | + apply %copy() : $@callee_guaranteed () -> () |
| 52 | + destroy_value %copy : $@callee_guaranteed () -> () |
| 53 | + %retval = load [trivial] %addr : $*Builtin.Int64 |
| 54 | + destroy_value %closure_lifetime : $@callee_guaranteed () -> () |
| 55 | + dealloc_stack %addr : $*Builtin.Int64 |
| 56 | + return %retval : $Builtin.Int64 |
| 57 | +} |
0 commit comments