Skip to content

Commit 9fbf41c

Browse files
committed
test: repair the IRGen tests after swiftlang#39680
The change in 39680 impacts more than WebAssembly, but it did not update the tests for impacted targets. (cherry picked from commit 3df2531)
1 parent 8079b35 commit 9fbf41c

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

test/IRGen/async/hop_to_executor.sil

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
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
22

33
// REQUIRES: concurrency
44

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+
59
sil_stage canonical
610

711
import Builtin
@@ -10,13 +14,14 @@ import _Concurrency
1014

1115
// CHECK-LABEL: define{{.*}} void @test_simple(
1216
// 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()
1519
// 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]+}})
1620
// 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]+}})
1721
// CHECK: [[RET_CONTINUATION:%.*]] = bitcast void (%swift.context*)* {{.*}} to i8*
1822
// 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
2025

2126
sil @test_simple : $@async (@guaranteed Optional<Builtin.Executor>) -> () {
2227
bb0(%0 : $Optional<Builtin.Executor>):

test/IRGen/async/non_musttail_target.sil

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Ensure that IRGen don't emit unreachable after coro.end.async for targets that don't support musttail call.
2-
// RUN: %swift -disable-legacy-type-info -parse-stdlib -target wasm32-unknown-wasi %s -disable-llvm-optzns -disable-swift-specific-llvm-optzns -disable-objc-interop -module-name main -emit-ir -o - | %FileCheck %s
2+
// RUN: %target-swift-frontend -disable-legacy-type-info -parse-stdlib %s -disable-llvm-optzns -disable-swift-specific-llvm-optzns -disable-objc-interop -module-name main -emit-ir -o - | %FileCheck %s
3+
34
// REQUIRES: concurrency
4-
// REQUIRES: CODEGENERATOR=WebAssembly
5+
// REQUIRES: OS=wasi || OS=windows-msvc
56

67
sil_stage canonical
78

0 commit comments

Comments
 (0)