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