@@ -16,6 +16,34 @@ public func async_dead_arg_call(o: consuming AnyObject) async {
1616 await bar ( )
1717}
1818
19+ // CHECK-LABEL: sil [ossa] @async_dead_arg_call_lexical : {{.*}} {
20+ // CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @_lexical @owned
21+ // CHECK: [[MOVE:%[^,]+]] = move_value [lexical] [[INSTANCE]]
22+ // CHECK: [[EXECUTOR:%[^,]+]] = enum $Optional<Builtin.Executor>, #Optional.none!enumelt
23+ // CHECK: [[CALLEE:%[^,]+]] = function_ref @async_callee
24+ // CHECK: apply [[CALLEE]]()
25+ // CHECK: hop_to_executor [[EXECUTOR]]
26+ // CHECK: destroy_value [[MOVE]]
27+ // CHECK-LABEL: } // end sil function 'async_dead_arg_call_lexical'
28+ @_silgen_name ( " async_dead_arg_call_lexical " )
29+ public func async_dead_arg_call_lexical( @_noEagerMove o: consuming AnyObject ) async {
30+ await bar ( )
31+ // o should be destroyed here
32+ }
33+
34+ extension C {
35+ // CHECK-LABEL: sil [ossa] @async_dead_arg_call_lexical_method : {{.*}} {
36+ // CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @_lexical @owned
37+ // CHECK-LABEL: } // end sil function 'async_dead_arg_call_lexical_method'
38+ @_silgen_name ( " async_dead_arg_call_lexical_method " )
39+ @_noEagerMove
40+ consuming
41+ public func async_dead_arg_call_lexical_method( ) async {
42+ await bar ( )
43+ // self should be destroyed here
44+ }
45+ }
46+
1947public class C {
2048 // CHECK-LABEL: sil [ossa] @async_dead_arg_call_method : {{.*}} {
2149 // CHECK: {{bb[0-9]+}}([[INSTANCE:%[^,]+]] : @_eagerMove @owned
0 commit comments