Skip to content

Commit ee22a6c

Browse files
committed
Enable concurrency-deleted-method.swift test for wasip1 (#83236)
The test is only partially enabled: we only check for IR correctness and correct linking. We don't run the tests on WASI yet due to unrelated issues that are going to be resolved separately.
1 parent ab7cd23 commit ee22a6c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

test/embedded/concurrency-deleted-method.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -parse-as-library -module-name main %s -emit-ir | %FileCheck --check-prefix=CHECK-IR %s
33
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -parse-as-library -module-name main %s -c -o %t/a.o
4-
// RUN: %target-clang %t/a.o -o %t/a.out -L%swift_obj_root/lib/swift/embedded/%target-cpu-apple-macos -lswift_Concurrency -lswift_ConcurrencyDefaultExecutor -dead_strip
5-
// RUN: %target-run %t/a.out | %FileCheck %s
4+
// RUN: %target-clang %t/a.o -o %t/a.out -L%swift_obj_root/lib/swift/embedded/%module-target-triple %target-clang-resource-dir-opt -lswift_Concurrency %target-swift-default-executor-opt -dead_strip
5+
// RUN: if [ %target-os != "wasip1" ]; then %target-run %t/a.out | %FileCheck %s; fi
66

77
// REQUIRES: executable_test
88
// REQUIRES: swift_in_compiler
99
// REQUIRES: optimized_stdlib
10-
// REQUIRES: OS=macosx
10+
// REQUIRES: OS=macosx || OS=wasip1
1111
// REQUIRES: swift_feature_Embedded
1212

1313
import _Concurrency
@@ -31,7 +31,7 @@ actor MyActor {
3131
}
3232

3333
// CHECK-IR: @swift_deletedAsyncMethodErrorTu =
34-
// CHECK-IR: @"$e4main7MyActorCN" = global <{ ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }> <{
34+
// CHECK-IR: @"$e4main7MyActorCN" = global <{ ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }> <{
3535
// CHECK-IR-SAME: ptr null,
3636
// CHECK-IR-SAME: ptr @"$e4main7MyActorCfD",
3737
// CHECK-IR-SAME: ptr null,
@@ -41,10 +41,10 @@ actor MyActor {
4141
// CHECK-IR-SAME: ptr @"$e4main7MyActorC3fooyyYaFTu",
4242
// CHECK-IR-SAME: ptr @got.swift_deletedAsyncMethodErrorTu,
4343
// CHECK-IR-SAME: ptr @"$e4main7MyActorCACycfC"
44-
// CHECK-IR-SAME: }>, align 8
44+
// CHECK-IR-SAME: }>, align {{[48]}}
4545

4646
// CHECK-IR-NOT: $e4main7MyActorC12thisIsUnusedyyYaF
4747

48-
// CHECK-IR: define swifttailcc void @swift_deletedAsyncMethodError(ptr swiftasync %0)
48+
// CHECK-IR: define {{swifttailcc|swiftcc}} void @swift_deletedAsyncMethodError(ptr swiftasync %0)
4949

5050
// CHECK: value: 42

test/lit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,7 @@ config.target_static_library_suffix = '.a'
12741274
config.target_env_prefix = ''
12751275
config.target_sdk_libcxx_path = ''
12761276
config.target_clang_resource_dir_opt = ''
1277+
config.target_swift_default_executor_opt = '-lswift_ConcurrencyDefaultExecutor'
12771278

12781279
if run_vendor == 'apple':
12791280
target_specific_module_triple = '{}-apple-{}'.format(
@@ -2051,6 +2052,7 @@ elif kIsWASI:
20512052
config.target_runtime = "native"
20522053
config.target_not_crash = "not"
20532054
config.target_clang_resource_dir_opt = f"-resource-dir {test_resource_dir}/../../../wasi-sysroot/wasm32-wasip1"
2055+
config.target_swift_default_executor_opt = ''
20542056

20552057
config.target_swift_autolink_extract = inferSwiftBinary("swift-autolink-extract")
20562058

@@ -3027,6 +3029,7 @@ config.substitutions.append(('%llvm-cov', config.llvm_cov))
30273029
config.substitutions.append(('%hmaptool', os.path.join(config.llvm_src_root, '..', 'clang', 'utils', 'hmaptool', 'hmaptool')))
30283030
config.substitutions.append(('%target-not-crash', config.target_not_crash))
30293031
config.substitutions.insert(0, ('%target-clang-resource-dir-opt', config.target_clang_resource_dir_opt))
3032+
config.substitutions.insert(0, ('%target-swift-default-executor-opt', config.target_swift_default_executor_opt))
30303033

30313034
# Set up the host library environment.
30323035
if hasattr(config, 'target_library_path_var'):

0 commit comments

Comments
 (0)