1
- // RUN: %target-swift-frontend -enable-experimental-concurrency -primary-file %s -module-name=test -disable-llvm-optzns -disable-swift-specific-llvm-optzns -emit-ir -sil-verify-all | %IRGenFileCheck %s
1
+ // RUN: %target-swift-frontend -enable-experimental-concurrency -primary-file %s -module-name=test -disable-llvm-optzns -disable-swift-specific-llvm-optzns -emit-ir -sil-verify-all | %IRGenFileCheck %s -check-prefix CHECK-%target-abi
2
2
3
3
// REQUIRES: concurrency
4
4
5
+ // WASI does not support the mandatory tail call, and needs to take the same
6
+ // path as CHECK-WIN, but will currently go down CHECK-SYSV, failing the test.
7
+ // XFAIL: OS=wasi
8
+
5
9
sil_stage canonical
6
10
7
11
import Builtin
@@ -10,13 +14,14 @@ import _Concurrency
10
14
11
15
// CHECK-LABEL: define{{.*}} void @test_simple(
12
16
// CHECK-SAME: %swift.context* swiftasync %0, [[INT]] %1, [[INT]] %2)
13
- // CHECK: [[CTX:%[0-9]+]] = bitcast %swift.context* %0
14
- // CHECK: [[RESUME:%[0-9]+]] = call i8* @llvm.coro.async.resume()
17
+ // CHECK-DAG : [[CTX:%[0-9]+]] = bitcast %swift.context* %0
18
+ // CHECK-DAG : [[RESUME:%[0-9]+]] = call i8* @llvm.coro.async.resume()
15
19
// CHECK-x86_64: call {{.*}} @llvm.coro.suspend.async{{.*}}(i32 0, i8* [[RESUME]], i8* bitcast (i8* (i8*)* @__swift_async_resume_get_context to i8*), i8* bitcast (void (i8*, [[INT]], [[INT]], %swift.context*)* @__swift_suspend_point to i8*), i8* [[RESUME]], [[INT]] %1, [[INT]] %2, %swift.context* {{%[0-9]+}})
16
20
// CHECK-arm64e: call {{.*}} @llvm.coro.suspend.async{{.*}}(i32 0, i8* [[RESUME]], i8* bitcast (i8* (i8*)* @__swift_async_resume_get_context to i8*), i8* bitcast (void (i8*, [[INT]], [[INT]], %swift.context*)* @__swift_suspend_point to i8*), i8* [[RESUME]], [[INT]] %1, [[INT]] %2, %swift.context* {{%[0-9]+}})
17
21
// CHECK: [[RET_CONTINUATION:%.*]] = bitcast void (%swift.context*)* {{.*}} to i8*
18
22
// CHECK: call i1 (i8*, i1, ...) @llvm.coro.end.async(i8* {{.*}}, i1 false, void (i8*, %swift.context*)* @[[TAIL_CALL_FUNC:.*]], i8* [[RET_CONTINUATION]]
19
- // CHECK: unreachable
23
+ // CHECK-WIN: ret void
24
+ // CHECK-SYSV: unreachable
20
25
21
26
sil @test_simple : $@async (@guaranteed Optional<Builtin.Executor>) -> () {
22
27
bb0(%0 : $Optional<Builtin.Executor>):
0 commit comments