Skip to content

Commit 084a3c9

Browse files
committed
add more variation to cross-module actor SIL test
1 parent 9bff2b4 commit 084a3c9

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

test/Concurrency/cross_module_let_sil.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import OtherActors
77

8-
// CHECK: sil hidden [ossa] @$s4test6check1ySi11OtherActors0C11ModuleActorCYaF : $@convention(thin) @async (@guaranteed OtherModuleActor) -> Int {
8+
// CHECK-LABEL: sil hidden [ossa] @$s4test6check1ySi11OtherActors0C11ModuleActorCYaF : $@convention(thin) @async (@guaranteed OtherModuleActor) -> Int {
99
// CHECK: bb0([[SELF:%[0-9]+]] : @guaranteed $OtherModuleActor):
1010
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $OtherModuleActor, #OtherModuleActor.a
1111
// CHECK: [[OLD:%[0-9]+]] = builtin "getCurrentExecutor"() : $Optional<Builtin.Executor>
@@ -25,14 +25,17 @@ func check3(_ actor: OtherModuleActor) async -> Int {
2525
return actor.b
2626
}
2727

28-
// CHECK: sil hidden [ossa] @$s4test6check4y11OtherActors17SomeSendableClassCAC0C11ModuleActorCYaF : $@convention(thin) @async (@guaranteed OtherModuleActor) -> @owned SomeSendableClass {
29-
// CHECK: bb0([[SELF:%[0-9]+]] : @guaranteed $OtherModuleActor):
30-
// CHECK: [[REF:%[0-9]+]] = ref_element_addr [[SELF]] : $OtherModuleActor, #OtherModuleActor.d
28+
// CHECK-LABEL: sil hidden [ossa] @$s4test6check4y11OtherActors17SomeSendableClassCSgAC0C11ModuleActorCSgYaF : $@convention(thin) @async (@guaranteed Optional<OtherModuleActor>) -> @owned Optional<SomeSendableClass> {
29+
// CHECK: bb0({{%[0-9]+}} : @guaranteed $Optional<OtherModuleActor>):
30+
// CHECK: switch_enum {{%[0-9]+}} : $Optional<OtherModuleActor>, case #Optional.some!enumelt: [[SOME:bb[0-9]+]], case #Optional.none!enumelt: {{bb[0-9]+}}
31+
32+
// CHECK: [[SOME]]({{%[0-9]+}} : @owned $OtherModuleActor):
33+
// CHECK: [[REF:%[0-9]+]] = ref_element_addr {{%[0-9]+}} : $OtherModuleActor, #OtherModuleActor.d
3134
// CHECK: [[OLD:%[0-9]+]] = builtin "getCurrentExecutor"() : $Optional<Builtin.Executor>
32-
// CHECK: hop_to_executor [[SELF]] : $OtherModuleActor
35+
// CHECK: hop_to_executor {{%[0-9]+}} : $OtherModuleActor
3336
// CHECK-NEXT: load [copy] [[REF]]
34-
// CHECK-NEXT: hop_to_executor [[OLD]] : $Optional<Builtin.Executor>
35-
// CHECK: } // end sil function '$s4test6check4y11OtherActors17SomeSendableClassCAC0C11ModuleActorCYaF'
36-
func check4(_ actor: OtherModuleActor) async -> SomeSendableClass {
37-
return await actor.d
37+
// CHECK: hop_to_executor [[OLD]] : $Optional<Builtin.Executor>
38+
// CHECK: } // end sil function '$s4test6check4y11OtherActors17SomeSendableClassCSgAC0C11ModuleActorCSgYaF'
39+
func check4(_ actor: OtherModuleActor?) async -> SomeSendableClass? {
40+
return await actor?.d
3841
}

0 commit comments

Comments
 (0)