From 27e5d5c551c5975a6c95631e9b87bd0b884352ed Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 24 Jun 2025 17:24:55 +0100 Subject: [PATCH] Fix/xfail/disable remaining tests for embedded Wasm --- test/CMakeLists.txt | 12 ++++++++++++ test/embedded/array-builtins-exec.swift | 6 ++---- test/embedded/basic-modules-generics-no-stdlib.swift | 2 +- test/embedded/basic-modules-no-stdlib.swift | 2 +- test/embedded/builtin-float.swift | 2 +- test/embedded/classes-arrays.swift | 6 ++---- test/embedded/classes-multi-module.swift | 4 ++-- test/embedded/classes-optional.swift | 2 +- test/embedded/classes-stack-promotion.swift | 4 ++-- test/embedded/classes.swift | 4 ++-- test/embedded/closures-heap.swift | 2 +- test/embedded/concurrency-simple.swift | 4 ++-- test/embedded/custom-print.swift | 2 +- test/embedded/deinit-release.swift | 2 +- test/embedded/deinit-release2.swift | 2 +- test/embedded/dependencies-random.swift | 9 ++++++--- test/embedded/dynamic-self.swift | 2 +- test/embedded/extensions.swift | 2 +- test/embedded/failable-crash.swift | 2 +- test/embedded/float-abi-hard.swift | 1 + test/embedded/fragile-reference.swift | 5 ++--- test/embedded/keypath-crash.swift | 4 ++-- test/embedded/linkage-mergeable-dead-strip.swift | 2 +- test/embedded/linkage-mergeable.swift | 2 +- test/embedded/linkage-mergeable2.swift | 2 +- test/embedded/linkage-mergeable3.swift | 2 +- test/embedded/linkage-mergeable4.swift | 2 +- test/embedded/modules-empty-object.swift | 2 +- test/embedded/modules-used2.swift | 2 +- test/embedded/no-allocations-print.swift | 3 +-- test/embedded/once-dependent.swift | 8 ++++---- test/embedded/optionset2.swift | 5 ++--- test/embedded/osize-genericspecializer.swift | 2 +- test/embedded/osize-releasedevirt.swift | 2 +- test/embedded/ouroboros-bug.swift | 5 ++--- test/embedded/static-object-non-darwin.swift | 4 ++-- test/embedded/stdlib-array.swift | 5 ++--- test/embedded/stdlib-basic.swift | 5 ++--- test/embedded/stdlib-dictionary.swift | 5 ++--- test/embedded/stdlib-random.swift | 5 ++--- test/embedded/stdlib-set.swift | 5 ++--- test/embedded/stdlib-strings-interpolation3.swift | 6 +++--- test/embedded/stdlib-types-riscv.swift | 1 + test/embedded/stdlib-types.swift | 5 ++--- test/embedded/synchronization.swift | 4 +--- test/embedded/traps-fatalerror-ir.swift | 1 + test/embedded/without-actually-escaping.swift | 2 +- test/lit.cfg | 10 ++++++++-- .../swift_build_support/products/wasisysroot.py | 4 ++++ 49 files changed, 97 insertions(+), 85 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 668e9711e38..a84741ae152 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -611,6 +611,18 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING) "${CMAKE_CURRENT_BINARY_DIR}${VARIANT_SUFFIX}/lit.site.cfg" "test${VARIANT_SUFFIX}.lit.site.cfg") swift_generate_lit_swift_features_cfg("${CMAKE_CURRENT_BINARY_DIR}${VARIANT_SUFFIX}/lit.swift-features.cfg") + + set(VARIANT_SUFFIX "-embedded-wasi") + set(VARIANT_TRIPLE "wasm32-unknown-wasip1") + set(VARIANT_EXTERNAL_EMBEDDED_PLATFORM FALSE) + set(VARIANT_EXTERNAL_EMBEDDED_DEVICE) + set(SWIFT_TEST_RESULTS_DIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/swift-test-results/${VARIANT_TRIPLE}") + swift_configure_lit_site_cfg( + "${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in" + "${CMAKE_CURRENT_BINARY_DIR}${VARIANT_SUFFIX}/lit.site.cfg" + "test${VARIANT_SUFFIX}.lit.site.cfg") + swift_generate_lit_swift_features_cfg("${CMAKE_CURRENT_BINARY_DIR}${VARIANT_SUFFIX}/lit.swift-features.cfg") + message(STATUS "SWIFT_LIT_ARGS is ${SWIFT_LIT_ARGS}") endif() # Add shortcuts for the default variant. diff --git a/test/embedded/array-builtins-exec.swift b/test/embedded/array-builtins-exec.swift index c13037769ff..c59c5d24815 100644 --- a/test/embedded/array-builtins-exec.swift +++ b/test/embedded/array-builtins-exec.swift @@ -1,7 +1,5 @@ // RUN: %empty-directory(%t) -// RUN: %target-swift-frontend %s -parse-as-library -enable-experimental-feature Embedded -enable-builtin-module -c -o %t/main.o -// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip -// RUN: %target-run %t/a.out | %FileCheck %s +// RUN: %target-run-simple-swift(-parse-as-library -enable-experimental-feature Embedded -wmo -enable-builtin-module) | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: executable_test @@ -41,7 +39,7 @@ func exerciseArrayValueWitnesses(_ value: T) { (buf + 0).initialize(to: value) (buf + 1).initialize(to: value) - + Builtin.copyArray(T.self, (buf + 2)._rawValue, buf._rawValue, 2._builtinWordValue) Builtin.takeArrayBackToFront(T.self, (buf + 1)._rawValue, buf._rawValue, 4._builtinWordValue) Builtin.takeArrayFrontToBack(T.self, buf._rawValue, (buf + 1)._rawValue, 4._builtinWordValue) diff --git a/test/embedded/basic-modules-generics-no-stdlib.swift b/test/embedded/basic-modules-generics-no-stdlib.swift index bb4f11507b8..ebe92203782 100644 --- a/test/embedded/basic-modules-generics-no-stdlib.swift +++ b/test/embedded/basic-modules-generics-no-stdlib.swift @@ -52,7 +52,7 @@ public func main() { protocolBoundFunc(GenericType(Bool())) } -// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1) +// CHECK: define {{.*}}i32 @{{_*}}main{{.*}}(i32 %0, ptr %1) // CHECK: define {{.*}}void @"$e4Main4BoolVACycfC"() // CHECK: define {{.*}}void @"$e4Main4mainyyF"() // CHECK: define {{.*}}void @"$e8MyModule14nonGenericFuncyyF"() diff --git a/test/embedded/basic-modules-no-stdlib.swift b/test/embedded/basic-modules-no-stdlib.swift index 891e8ef6234..ed63816ef7c 100644 --- a/test/embedded/basic-modules-no-stdlib.swift +++ b/test/embedded/basic-modules-no-stdlib.swift @@ -38,7 +38,7 @@ public func main() { moduleMain() } -// CHECK: define {{.*}}@main{{.*}} { +// CHECK: define {{.*}}@{{_*}}main{{.*}} { // CHECK: define {{.*}}void @"$e4Main4mainyyF"{{.*}} { // CHECK: define {{.*}}void @"$e8MyModule10moduleMainyyF"{{.*}} { // CHECK: define {{.*}}void @"$e8MyModule8ConcreteVACycfC"{{.*}} { diff --git a/test/embedded/builtin-float.swift b/test/embedded/builtin-float.swift index 992af5d029a..eecd66ac298 100644 --- a/test/embedded/builtin-float.swift +++ b/test/embedded/builtin-float.swift @@ -2,7 +2,7 @@ // RUN: mkdir -p %t/include // RUN: %{python} %utils/split_file.py -o %t %s -// RUN: %target-swift-frontend -target armv7em-none-none-eabi -emit-ir %t/Main.swift -enable-experimental-feature Embedded -module-cache-path %t/ModuleCache -Xcc -I%t/include +// RUN: %target-swift-frontend -target %target-triple -emit-ir %t/Main.swift -enable-experimental-feature Embedded -module-cache-path %t/ModuleCache -Xcc -I%t/include // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib diff --git a/test/embedded/classes-arrays.swift b/test/embedded/classes-arrays.swift index 86fc1285248..e6883f2a8e6 100644 --- a/test/embedded/classes-arrays.swift +++ b/test/embedded/classes-arrays.swift @@ -1,7 +1,5 @@ // RUN: %empty-directory(%t) -// RUN: %target-swift-frontend %s -parse-as-library -enable-experimental-feature Embedded -c -o %t/main.o -// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip -// RUN: %target-run %t/a.out | %FileCheck %s +// RUN: %target-run-simple-swift(-parse-as-library -enable-experimental-feature Embedded -wmo) | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: executable_test @@ -56,7 +54,7 @@ struct Main { // CHECK: MySubSubClass.foo } print("") - + print("5") // CHECK: 5 objects = [] // CHECK: MyClass.deinit diff --git a/test/embedded/classes-multi-module.swift b/test/embedded/classes-multi-module.swift index 9bbc5664d3a..a444fac53b3 100644 --- a/test/embedded/classes-multi-module.swift +++ b/test/embedded/classes-multi-module.swift @@ -3,7 +3,7 @@ // RUN: %target-swift-frontend -enable-experimental-feature Embedded -c -I%t -parse-as-library %t/MyModule.swift -o %t/MyModule.o -emit-module -emit-module-path %t/MyModule.swiftmodule -emit-empty-object-file // RUN: %target-swift-frontend -enable-experimental-feature Embedded -c -I%t %t/Main.swift -o %t/Main.o -// RUN: %target-clang %t/Main.o %t/MyModule.o -o %t/a.out +// RUN: %target-clang %target-clang-resource-dir-opt %t/Main.o %t/MyModule.o -o %t/a.out // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: executable_test @@ -28,7 +28,7 @@ class X { var x: T init(x: T) { self.x = x } - + func bar() { print(x) } diff --git a/test/embedded/classes-optional.swift b/test/embedded/classes-optional.swift index 0229977022b..c379f638864 100644 --- a/test/embedded/classes-optional.swift +++ b/test/embedded/classes-optional.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) // RUN: %target-swift-frontend %s -enable-experimental-feature Embedded -c -o %t/main.o -// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip +// RUN: %target-clang %target-clang-resource-dir-opt %t/main.o -o %t/a.out -dead_strip // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/classes-stack-promotion.swift b/test/embedded/classes-stack-promotion.swift index c2f1855a713..6220c1cef17 100644 --- a/test/embedded/classes-stack-promotion.swift +++ b/test/embedded/classes-stack-promotion.swift @@ -1,7 +1,7 @@ // RUN: %empty-directory(%t) // RUN: %target-swift-frontend -O -Xllvm -sil-disable-pass=function-signature-opts %s -parse-as-library -enable-experimental-feature Embedded -module-name main -emit-irgen | %FileCheck %s --check-prefix CHECK-IR // RUN: %target-swift-frontend -O -Xllvm -sil-disable-pass=function-signature-opts %s -parse-as-library -enable-experimental-feature Embedded -c -o %t/main.o -// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip +// RUN: %target-clang %target-clang-resource-dir-opt %t/main.o -o %t/a.out -dead_strip // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler @@ -77,7 +77,7 @@ struct Main { // CHECK-IR-NEXT: ret void // CHECK-IR-NEXT: } -// CHECK-IR: define {{.*}}@main +// CHECK-IR: define {{.*}}@{{_*}}main // CHECK-IR-NEXT: entry: // CHECK-IR-NEXT: alloca %T4main10MySubClassC // CHECK-IR-NEXT: alloca %T4main12MyFinalClassC diff --git a/test/embedded/classes.swift b/test/embedded/classes.swift index 14ecb79863d..5ca3ef093e1 100644 --- a/test/embedded/classes.swift +++ b/test/embedded/classes.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) // RUN: %target-swift-frontend %s -parse-as-library -enable-experimental-feature Embedded -c -o %t/main.o -// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip +// RUN: %target-clang %target-clang-resource-dir-opt %t/main.o -o %t/a.out -dead_strip // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler @@ -84,7 +84,7 @@ struct Main { // CHECK: MySubClass.foo // CHECK: MySubSubClass.foo print("") - + print("5") // CHECK: 5 o.0 = nil // CHECK: MyClass.deinit diff --git a/test/embedded/closures-heap.swift b/test/embedded/closures-heap.swift index b685b345823..97f34a02007 100644 --- a/test/embedded/closures-heap.swift +++ b/test/embedded/closures-heap.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) // RUN: %target-swift-frontend %s -parse-as-library -enable-experimental-feature Embedded -c -o %t/main.o -// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip +// RUN: %target-clang %target-clang-resource-dir-opt %t/main.o -o %t/a.out -dead_strip // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/concurrency-simple.swift b/test/embedded/concurrency-simple.swift index aaa45c289d1..2af5755a0ad 100644 --- a/test/embedded/concurrency-simple.swift +++ b/test/embedded/concurrency-simple.swift @@ -1,12 +1,12 @@ // RUN: %empty-directory(%t) // RUN: %target-swift-frontend -enable-experimental-feature Embedded -parse-as-library %s -c -o %t/a.o -// 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 +// RUN: %target-clang %target-clang-resource-dir-opt %t/a.o -o %t/a.out -L%swift_obj_root/lib/swift/embedded/%target-triple -lc++ -lswift_Concurrency -lswift_ConcurrencyDefaultExecutor -dead_strip // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: executable_test // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib -// REQUIRES: OS=macosx +// REQUIRES: OS=macosx || OS=wasi // REQUIRES: swift_feature_Embedded import _Concurrency diff --git a/test/embedded/custom-print.swift b/test/embedded/custom-print.swift index c12087c31a3..2c1f649685f 100644 --- a/test/embedded/custom-print.swift +++ b/test/embedded/custom-print.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) // RUN: %target-swift-frontend -enable-experimental-feature Extern -enable-experimental-feature Embedded -enforce-exclusivity=none %s -c -o %t/a.o -// RUN: %target-clang %t/a.o -o %t/a.out +// RUN: %target-clang %target-clang-resource-dir-opt %t/a.o -o %t/a.out // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/deinit-release.swift b/test/embedded/deinit-release.swift index 059c87d99c6..cdb50cdfcce 100644 --- a/test/embedded/deinit-release.swift +++ b/test/embedded/deinit-release.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) // RUN: %target-swift-frontend %s -enable-experimental-feature Embedded -O -c -o %t/main.o -// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip +// RUN: %target-clang %target-clang-resource-dir-opt %t/main.o -o %t/a.out -dead_strip // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/deinit-release2.swift b/test/embedded/deinit-release2.swift index 8683254177b..a54edd88018 100644 --- a/test/embedded/deinit-release2.swift +++ b/test/embedded/deinit-release2.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) // RUN: %target-swift-frontend %s -enable-experimental-feature Embedded -O -c -o %t/main.o -// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip +// RUN: %target-clang %target-clang-resource-dir-opt %t/main.o -o %t/a.out -dead_strip // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/dependencies-random.swift b/test/embedded/dependencies-random.swift index 37fe4d741c1..106784f4076 100644 --- a/test/embedded/dependencies-random.swift +++ b/test/embedded/dependencies-random.swift @@ -3,8 +3,11 @@ // RUN: grep DEP\: %s | sed 's#// DEP\: ##' | sort > %t/allowed-dependencies.txt -// Linux/ELF doesn't use the "_" prefix in symbol mangling. -// RUN: if [ %target-os == "linux-gnu" ]; then sed -E -i -e 's/^_(.*)$/\1/' %t/allowed-dependencies.txt; fi +// Linux/ELF and Wasm don't use the "_" prefix in symbol mangling. +// RUN: if [ %target-os == "linux-gnu" ] || [ %target-os == "wasi" ]; then sed -E -i -e 's/^_(.*)$/\1/' %t/allowed-dependencies.txt; fi + +// Wasm has additional dependencies +// RUN: if [ %target-os == "wasi" ]; then ex -sc '3i|__stack_pointer' -sc '1i|__memory_base' -sc '1i|__indirect_function_table' -cx %t/allowed-dependencies.txt; fi // RUN: %llvm-nm --undefined-only --format=just-symbols %t/a.o | sort | tee %t/actual-dependencies.txt @@ -22,7 +25,7 @@ // RUN: %target-clang -x c -c %S/Inputs/print.c -o %t/print.o // RUN: %target-clang -x c -c %S/Inputs/linux-rng-support.c -o %t/linux-rng-support.o -// RUN: %target-clang %t/a.o %t/print.o %t/linux-rng-support.o -o %t/a.out +// RUN: %target-clang %target-clang-resource-dir-opt %t/a.o %t/print.o %t/linux-rng-support.o -o %t/a.out // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/dynamic-self.swift b/test/embedded/dynamic-self.swift index 9e72762b2a9..63b55f32806 100644 --- a/test/embedded/dynamic-self.swift +++ b/test/embedded/dynamic-self.swift @@ -18,4 +18,4 @@ struct Main { } } -// CHECK: define {{.*}}@main( +// CHECK: define {{.*}}@{{_*}}main{{.*}}( diff --git a/test/embedded/extensions.swift b/test/embedded/extensions.swift index a05675a3726..495e288d329 100644 --- a/test/embedded/extensions.swift +++ b/test/embedded/extensions.swift @@ -19,6 +19,6 @@ struct MyStruct {} extension MyStruct: MyProtocol {} -// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1) +// CHECK: define {{.*}}i32 @{{_*}}main{{.*}}(i32 %0, ptr %1) // CHECK-NOT: MyStruct // CHECK-NOT: MyProtocol diff --git a/test/embedded/failable-crash.swift b/test/embedded/failable-crash.swift index 8f95c7c48e9..8724c61301b 100644 --- a/test/embedded/failable-crash.swift +++ b/test/embedded/failable-crash.swift @@ -16,4 +16,4 @@ public class MyClass { } } -// CHECK: define {{.*}}@main( +// CHECK: define {{.*}}@{{_*}}main{{.*}}( diff --git a/test/embedded/float-abi-hard.swift b/test/embedded/float-abi-hard.swift index ef35933eb25..d81b8792af8 100644 --- a/test/embedded/float-abi-hard.swift +++ b/test/embedded/float-abi-hard.swift @@ -4,6 +4,7 @@ // RUN: %target-swift-emit-ir %t/Main.swift -import-bridging-header %t/BridgingHeader.h -parse-as-library -enable-experimental-feature Embedded -wmo \ // RUN: -target armv7em-none-none-eabi -Xcc -mthumb -Xcc -mcpu=cortex-m7 -Xcc -mfloat-abi=hard -Xcc -mfpu=fpv5-sp-d16 -Xcc -D__FPU_USED=1 -Xcc -falign-functions=16 +// UNSUPPORTED: OS=wasi // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib // REQUIRES: CODEGENERATOR=ARM diff --git a/test/embedded/fragile-reference.swift b/test/embedded/fragile-reference.swift index 9ee8c4e6d85..08459e3d350 100644 --- a/test/embedded/fragile-reference.swift +++ b/test/embedded/fragile-reference.swift @@ -1,5 +1,4 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// RUN: %target-swift-frontend -target arm64-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: CODEGENERATOR=ARM // REQUIRES: embedded_stdlib_cross_compiling @@ -17,5 +16,5 @@ enum MyEnum: UInt8 { case a = 0 } -// CHECK: define {{.*}}@main( +// CHECK: define {{.*}}@{{_*}}main{{.*}}( diff --git a/test/embedded/keypath-crash.swift b/test/embedded/keypath-crash.swift index e33d24ce7e0..ae62fb9f270 100644 --- a/test/embedded/keypath-crash.swift +++ b/test/embedded/keypath-crash.swift @@ -20,7 +20,7 @@ public struct Binding { public struct State { public var wrappedValue: Wrapped - + public init(wrappedValue: Wrapped) { self.wrappedValue = wrappedValue } @@ -51,4 +51,4 @@ public struct S { } } -// CHECK: define {{.*}}@main( +// CHECK: define {{.*}}@{{_*}}main{{.*}}( diff --git a/test/embedded/linkage-mergeable-dead-strip.swift b/test/embedded/linkage-mergeable-dead-strip.swift index 66dc820e691..809eea56f0d 100644 --- a/test/embedded/linkage-mergeable-dead-strip.swift +++ b/test/embedded/linkage-mergeable-dead-strip.swift @@ -2,7 +2,7 @@ // RUN: %target-swift-frontend -enable-experimental-feature Embedded -enable-experimental-feature SymbolLinkageMarkers -module-name main -mergeable-symbols -O %s -emit-ir | %FileCheck %s --check-prefix=CHECK-IR // RUN: %target-swift-frontend -enable-experimental-feature Embedded -enable-experimental-feature SymbolLinkageMarkers -module-name main -mergeable-symbols -O %s -c -o %t/a.o -// RUN: %target-clang %t/a.o -o %t/a.out -dead_strip +// RUN: %target-clang %target-clang-resource-dir-opt %t/a.o -o %t/a.out -dead_strip // RUN: %llvm-nm --defined-only --format=just-symbols --demangle %t/a.out | sort | %FileCheck %s --check-prefix=CHECK-NM // RUN: %target-run %t/a.out | %FileCheck %s diff --git a/test/embedded/linkage-mergeable.swift b/test/embedded/linkage-mergeable.swift index 8748407a445..0912992dcdd 100644 --- a/test/embedded/linkage-mergeable.swift +++ b/test/embedded/linkage-mergeable.swift @@ -3,7 +3,7 @@ // RUN: %target-swift-frontend -mergeable-symbols -c -emit-module -o %t/MyModule.o %t/MyModule.swift -enable-experimental-feature Embedded -parse-as-library // RUN: %target-swift-frontend -mergeable-symbols -c -o %t/a.o %t/Main.swift -I %t -enable-experimental-feature Embedded -// RUN: %target-clang %t/a.o %t/MyModule.o -o %t/a.out +// RUN: %target-clang %target-clang-resource-dir-opt %t/a.o %t/MyModule.o -o %t/a.out // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/linkage-mergeable2.swift b/test/embedded/linkage-mergeable2.swift index fac25086b70..ea121b1f6d8 100644 --- a/test/embedded/linkage-mergeable2.swift +++ b/test/embedded/linkage-mergeable2.swift @@ -3,7 +3,7 @@ // RUN: %target-swift-frontend -mergeable-symbols -O -c -emit-module -o %t/MyModule.o %t/MyModule.swift -enable-experimental-feature Embedded -parse-as-library // RUN: %target-swift-frontend -mergeable-symbols -O -c -o %t/a.o %t/Main.swift -I %t -enable-experimental-feature Embedded -// RUN: %target-clang %t/a.o %t/MyModule.o -o %t/a.out +// RUN: %target-clang %target-clang-resource-dir-opt %t/a.o %t/MyModule.o -o %t/a.out // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/linkage-mergeable3.swift b/test/embedded/linkage-mergeable3.swift index e8d3b81cdcd..10e0be03b5b 100644 --- a/test/embedded/linkage-mergeable3.swift +++ b/test/embedded/linkage-mergeable3.swift @@ -3,7 +3,7 @@ // RUN: %target-swift-frontend -mergeable-symbols -num-threads 2 -O -c -emit-module -o %t/MyModule.o %t/MyModule.swift -enable-experimental-feature Embedded -parse-as-library // RUN: %target-swift-frontend -mergeable-symbols -num-threads 2 -O -c -o %t/MainA.o -o %t/MainB.o %t/MainA.swift %t/MainB.swift -I %t -enable-experimental-feature Embedded -parse-as-library -// RUN: %target-clang %t/MainA.o %t/MainB.o %t/MyModule.o -o %t/a.out +// RUN: %target-clang %target-clang-resource-dir-opt %t/MainA.o %t/MainB.o %t/MyModule.o -o %t/a.out // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/linkage-mergeable4.swift b/test/embedded/linkage-mergeable4.swift index d92fc65180a..eb2124afc37 100644 --- a/test/embedded/linkage-mergeable4.swift +++ b/test/embedded/linkage-mergeable4.swift @@ -3,7 +3,7 @@ // RUN: %target-swift-frontend -mergeable-symbols -num-threads 2 -O -c -emit-module -o %t/MyModule.o %t/MyModule.swift -enable-experimental-feature Embedded -parse-as-library // RUN: %target-swift-frontend -mergeable-symbols -num-threads 2 -O -c -o %t/MainA.o -o %t/MainB.o %t/MainA.swift %t/MainB.swift -I %t -enable-experimental-feature Embedded -parse-as-library -// RUN: %target-embedded-link %t/MainA.o %t/MainB.o %t/MyModule.o -o %t/a.out +// RUN: %target-embedded-link %target-clang-resource-dir-opt %t/MainA.o %t/MainB.o %t/MyModule.o -o %t/a.out // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/modules-empty-object.swift b/test/embedded/modules-empty-object.swift index 5cbbf0b4d49..baf59fa11f5 100644 --- a/test/embedded/modules-empty-object.swift +++ b/test/embedded/modules-empty-object.swift @@ -5,7 +5,7 @@ // RUN: %target-swift-frontend -enable-experimental-feature Embedded -c -I%t -parse-as-library %t/MyModuleB.swift -o %t/MyModuleB.o -emit-module -emit-module-path %t/MyModuleB.swiftmodule -emit-empty-object-file // RUN: %target-swift-frontend -enable-experimental-feature Embedded -c -I%t -parse-as-library %t/MyModuleC.swift -o %t/MyModuleC.o -emit-module -emit-module-path %t/MyModuleC.swiftmodule -emit-empty-object-file // RUN: %target-swift-frontend -enable-experimental-feature Embedded -c -I%t %t/Main.swift -o %t/Main.o -// RUN: %target-clang %t/Main.o %t/MyModuleA.o %t/MyModuleB.o %t/MyModuleC.o -o %t/a.out +// RUN: %target-clang %target-clang-resource-dir-opt %t/Main.o %t/MyModuleA.o %t/MyModuleB.o %t/MyModuleC.o -o %t/a.out // RUN: %target-run %t/a.out // REQUIRES: swift_in_compiler diff --git a/test/embedded/modules-used2.swift b/test/embedded/modules-used2.swift index d5a52fe3b33..d1e9ad0a8e7 100644 --- a/test/embedded/modules-used2.swift +++ b/test/embedded/modules-used2.swift @@ -4,7 +4,7 @@ // RUN: %target-swift-frontend -enable-experimental-feature SymbolLinkageMarkers -enable-experimental-feature Embedded -parse-as-library -emit-module -o %t/MyModule.swiftmodule %t/MyModule.swift // RUN: %target-swift-frontend -enable-experimental-feature SymbolLinkageMarkers -enable-experimental-feature Embedded -parse-as-library -I %t %t/Main.swift -emit-sil | %FileCheck %s --check-prefix CHECK-SIL // RUN: %target-swift-frontend -enable-experimental-feature SymbolLinkageMarkers -enable-experimental-feature Embedded -parse-as-library -I %t %t/Main.swift -c -o %t/a.o -// RUN: %target-clang %t/a.o -o %t/a.out +// RUN: %target-clang %target-clang-resource-dir-opt %t/a.o -o %t/a.out // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/embedded/no-allocations-print.swift b/test/embedded/no-allocations-print.swift index 6b4ebb3ea44..c6d08383b7a 100644 --- a/test/embedded/no-allocations-print.swift +++ b/test/embedded/no-allocations-print.swift @@ -1,7 +1,6 @@ // RUN: %target-swift-emit-ir %s -enable-experimental-feature Embedded -no-allocations -// RUN: %target-swift-emit-ir -target armv7-apple-none-macho -no-allocations %s -enable-experimental-feature Embedded -// RUN: %target-swift-emit-ir -target arm64-apple-none-macho -no-allocations %s -enable-experimental-feature Embedded +// RUN: %target-swift-emit-ir -target %target-triple -no-allocations %s -enable-experimental-feature Embedded // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib diff --git a/test/embedded/once-dependent.swift b/test/embedded/once-dependent.swift index 3978b2c14e1..b66cd5dca4c 100644 --- a/test/embedded/once-dependent.swift +++ b/test/embedded/once-dependent.swift @@ -1,5 +1,5 @@ // RUN: %target-swift-frontend %s -parse-as-library -enable-experimental-feature Embedded -c -o %t/main.o -// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip +// RUN: %target-clang %target-clang-resource-dir-opt %t/main.o -o %t/a.out -dead_strip // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler @@ -9,7 +9,7 @@ public struct MyStructA { static var singleton = MyStructA() - + init() { print("MyStructA.init") _ = MyStructB.singleton @@ -19,7 +19,7 @@ public struct MyStructA { public struct MyStructB { static var singleton = MyStructB() - + init() { print("MyStructB.init") _ = MyStructC.singleton @@ -29,7 +29,7 @@ public struct MyStructB { public struct MyStructC { static var singleton = MyStructC() - + init() { print("MyStructC.init") print("MyStructC.init done") diff --git a/test/embedded/optionset2.swift b/test/embedded/optionset2.swift index 59c976872fa..75654de7dfa 100644 --- a/test/embedded/optionset2.swift +++ b/test/embedded/optionset2.swift @@ -1,5 +1,4 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib @@ -31,4 +30,4 @@ struct ShippingOptions: MyOptionSet { var s = ShippingOptions(rawValue: 42) print(s.isEmpty) -// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1) +// CHECK: define {{.*}}i32 @{{_*}}main{{.*}}(i32 %0, ptr %1) diff --git a/test/embedded/osize-genericspecializer.swift b/test/embedded/osize-genericspecializer.swift index ff7bd1ca5af..6057efb4973 100644 --- a/test/embedded/osize-genericspecializer.swift +++ b/test/embedded/osize-genericspecializer.swift @@ -15,4 +15,4 @@ public func baz(n: T) { let x: ContiguousArray = .init(repeating: 0, count: 1) } -// CHECK: define {{.*}}@main( +// CHECK: define {{.*}}@{{_*}}main{{.*}}( diff --git a/test/embedded/osize-releasedevirt.swift b/test/embedded/osize-releasedevirt.swift index 9ef0fac78ae..cb266de5f73 100644 --- a/test/embedded/osize-releasedevirt.swift +++ b/test/embedded/osize-releasedevirt.swift @@ -11,4 +11,4 @@ public func foo() { func bar(_: UnsafePointer) { } -// CHECK: define {{.*}}@main( +// CHECK: define {{.*}}@{{_*}}main{{.*}}( diff --git a/test/embedded/ouroboros-bug.swift b/test/embedded/ouroboros-bug.swift index 08472ab80c2..73eeb1b10e7 100644 --- a/test/embedded/ouroboros-bug.swift +++ b/test/embedded/ouroboros-bug.swift @@ -3,8 +3,7 @@ // code, but in the embedded Swift's runtime that's somewhat reasonable thing // to do (but is to be avoided because of this). -// RUN: %target-swift-frontend -target armv7-apple-none-macho -assert-config Debug -Osize -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// RUN: %target-swift-frontend -target arm64-apple-none-macho -assert-config Debug -Osize -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -assert-config Debug -Osize -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib @@ -18,4 +17,4 @@ public func test() {} test() -// CHECK: define {{.*}}i32 @main +// CHECK: define {{.*}}i32 @{{_*}}main{{.*}} diff --git a/test/embedded/static-object-non-darwin.swift b/test/embedded/static-object-non-darwin.swift index 462f4c73cc9..a29f1ffd617 100644 --- a/test/embedded/static-object-non-darwin.swift +++ b/test/embedded/static-object-non-darwin.swift @@ -1,5 +1,5 @@ -// RUN: %target-swift-frontend -target armv7em-none-none-eabi -parse-as-library -module-name main -O -emit-ir %s -enable-experimental-feature Embedded -Xllvm -link-embedded-runtime=0 | %FileCheck %s -// RUN: %target-swift-frontend -target armv7em-none-none-eabi -parse-as-library -module-name main -Osize -emit-ir %s -enable-experimental-feature Embedded -Xllvm -link-embedded-runtime=0 | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -parse-as-library -module-name main -O -emit-ir %s -enable-experimental-feature Embedded -Xllvm -link-embedded-runtime=0 | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -parse-as-library -module-name main -Osize -emit-ir %s -enable-experimental-feature Embedded -Xllvm -link-embedded-runtime=0 | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib diff --git a/test/embedded/stdlib-array.swift b/test/embedded/stdlib-array.swift index 9657921f5ae..b4a8deffc46 100644 --- a/test/embedded/stdlib-array.swift +++ b/test/embedded/stdlib-array.swift @@ -1,5 +1,4 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib @@ -33,4 +32,4 @@ public func test() { test() -// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1) +// CHECK: define {{.*}}i32 @{{_*}}main{{.*}}(i32 %0, ptr %1) diff --git a/test/embedded/stdlib-basic.swift b/test/embedded/stdlib-basic.swift index 2fa2f7e3e1d..b2894bb9bdb 100644 --- a/test/embedded/stdlib-basic.swift +++ b/test/embedded/stdlib-basic.swift @@ -1,5 +1,4 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: CODEGENERATOR=ARM @@ -46,7 +45,7 @@ public func checks(n: Int) { if n < 0 { assertionFailure("with message") } } -// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1) +// CHECK: define {{.*}}i32 @{{_*}}main{{.*}}(i32 %0, ptr %1) // CHECK: define {{.*}}i1 @"$e4main4boolSbyF"() // CHECK: define {{.*}}{{i32|i64}} @"$e4main3intSiyF"() // CHECK: define {{.*}}ptr @"$e4main3ptr1p1nS2V_SitF"(ptr %0, {{i32|i64}} %1) diff --git a/test/embedded/stdlib-dictionary.swift b/test/embedded/stdlib-dictionary.swift index 53b37e7218e..b94e816902d 100644 --- a/test/embedded/stdlib-dictionary.swift +++ b/test/embedded/stdlib-dictionary.swift @@ -1,5 +1,4 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib @@ -20,4 +19,4 @@ public func test() { test() -// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1) +// CHECK: define {{.*}}i32 @{{_*}}main{{.*}}(i32 %0, ptr %1) diff --git a/test/embedded/stdlib-random.swift b/test/embedded/stdlib-random.swift index c9472fe305d..9c885e3ebbb 100644 --- a/test/embedded/stdlib-random.swift +++ b/test/embedded/stdlib-random.swift @@ -1,5 +1,4 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib @@ -19,4 +18,4 @@ public func test() { test() -// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1) +// CHECK: define {{.*}}i32 @{{_*}}main{{.*}}(i32 %0, ptr %1) diff --git a/test/embedded/stdlib-set.swift b/test/embedded/stdlib-set.swift index e81506d8430..5c5ac210966 100644 --- a/test/embedded/stdlib-set.swift +++ b/test/embedded/stdlib-set.swift @@ -1,5 +1,4 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib @@ -28,4 +27,4 @@ public func test() { test() -// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1) +// CHECK: define {{.*}}i32 @{{_*}}main{{.*}}(i32 %0, ptr %1) diff --git a/test/embedded/stdlib-strings-interpolation3.swift b/test/embedded/stdlib-strings-interpolation3.swift index 7631046caed..45fac2a1d94 100644 --- a/test/embedded/stdlib-strings-interpolation3.swift +++ b/test/embedded/stdlib-strings-interpolation3.swift @@ -1,6 +1,6 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -O -// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -Osize +// RUN: %target-swift-frontend -target %target-triple -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded +// RUN: %target-swift-frontend -target %target-triple -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -O +// RUN: %target-swift-frontend -target %target-triple -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -Osize // REQUIRES: swift_in_compiler // REQUIRES: CODEGENERATOR=ARM diff --git a/test/embedded/stdlib-types-riscv.swift b/test/embedded/stdlib-types-riscv.swift index 0d4bdacf069..0ab6f2c95d9 100644 --- a/test/embedded/stdlib-types-riscv.swift +++ b/test/embedded/stdlib-types-riscv.swift @@ -6,6 +6,7 @@ // REQUIRES: CODEGENERATOR=RISCV // REQUIRES: embedded_stdlib_cross_compiling // REQUIRES: swift_feature_Embedded +// UNSUPPORTED: OS=wasi class MyClass {} diff --git a/test/embedded/stdlib-types.swift b/test/embedded/stdlib-types.swift index cbd2b65e2d9..b07203e9573 100644 --- a/test/embedded/stdlib-types.swift +++ b/test/embedded/stdlib-types.swift @@ -1,5 +1,4 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s -// RUN: %target-swift-frontend -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %target-swift-frontend -target %target-triple -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib @@ -47,4 +46,4 @@ public func test() { test() -// CHECK: define {{.*}}i32 @main(i32 %0, ptr %1) +// CHECK: define {{.*}}i32 @{{_*}}main{{.*}}(i32 %0, ptr %1) diff --git a/test/embedded/synchronization.swift b/test/embedded/synchronization.swift index 751353928b2..d2a2fb7ffbd 100644 --- a/test/embedded/synchronization.swift +++ b/test/embedded/synchronization.swift @@ -1,7 +1,5 @@ // RUN: %empty-directory(%t) -// RUN: %target-swift-frontend %s -parse-as-library -enable-experimental-feature Embedded -disable-availability-checking -c -o %t/main.o -// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip -// RUN: %target-run %t/a.out | %FileCheck %s +// RUN: %target-run-simple-swift(-parse-as-library -enable-experimental-feature Embedded -disable-availability-checking -wmo) | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: executable_test diff --git a/test/embedded/traps-fatalerror-ir.swift b/test/embedded/traps-fatalerror-ir.swift index 0fb7b66abe1..caab67c578f 100644 --- a/test/embedded/traps-fatalerror-ir.swift +++ b/test/embedded/traps-fatalerror-ir.swift @@ -4,6 +4,7 @@ // RUN: %target-swift-emit-ir -enable-experimental-feature Embedded -wmo %s -O -assert-config Debug | %FileCheck %s --check-prefix=CHECK-MESSAGE // RUN: %target-swift-emit-ir -enable-experimental-feature Embedded -wmo %s -Osize -assert-config Debug | %FileCheck %s --check-prefix=CHECK-MESSAGE +// XFAIL: OS=wasi // REQUIRES: swift_in_compiler // REQUIRES: optimized_stdlib // REQUIRES: swift_stdlib_no_asserts diff --git a/test/embedded/without-actually-escaping.swift b/test/embedded/without-actually-escaping.swift index 48e1cd9adc6..301a0a66b4c 100644 --- a/test/embedded/without-actually-escaping.swift +++ b/test/embedded/without-actually-escaping.swift @@ -2,7 +2,7 @@ // RUN: %target-clang -x c -c %S/Inputs/unbuffered-putchar.c -o %t/unbuffered-putchar.o // RUN: %target-build-swift -enable-experimental-feature Embedded -wmo %s -Xlinker %t/unbuffered-putchar.o -o %t/a.out -// RUN: not --crash %t/a.out 2>&1 | %FileCheck %s +// RUN: %target-not-crash %target-run %t/a.out 2>&1 | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: executable_test diff --git a/test/lit.cfg b/test/lit.cfg index 74491259245..7ee83dbd182 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -1276,6 +1276,7 @@ target_specific_module_triple = config.variant_triple target_future = target_specific_module_triple config.target_run = '' +config.target_not_crash = 'not --crash' config.target_rtti_opt = '-fno-rtti' config.target_pic_opt = '' config.target_cxx_lib = '-lc++' @@ -1284,6 +1285,7 @@ config.target_static_library_prefix = 'lib' config.target_static_library_suffix = '.a' config.target_env_prefix = '' config.target_sdk_libcxx_path = '' +config.target_clang_resource_dir_opt = '' if run_vendor == 'apple': target_specific_module_triple = '{}-apple-{}'.format( @@ -2061,6 +2063,8 @@ elif run_os == 'wasi': config.target_shared_library_suffix = ".a" config.target_sdk_name = "wasi" config.target_runtime = "native" + config.target_not_crash = "not" + config.target_clang_resource_dir_opt = f"-resource-dir {test_resource_dir}/../../../wasi-sysroot/wasm32-wasi" config.target_swift_autolink_extract = inferSwiftBinary("swift-autolink-extract") @@ -2131,7 +2135,7 @@ elif run_os == 'wasi': elif config.external_embedded_platform: lit_config.note("Testing embedded platform " + config.variant_triple) - + config.target_object_format = "elf" config.target_sdk_name = "embedded" config.target_runtime = "native" @@ -3033,6 +3037,8 @@ config.substitutions.append(('%target-resilience-test', config.target_resilience config.substitutions.append(('%llvm-profdata', config.llvm_profdata)) config.substitutions.append(('%llvm-cov', config.llvm_cov)) config.substitutions.append(('%hmaptool', os.path.join(config.llvm_src_root, '..', 'clang', 'utils', 'hmaptool', 'hmaptool'))) +config.substitutions.append(('%target-not-crash', config.target_not_crash)) +config.substitutions.insert(0, ('%target-clang-resource-dir-opt', config.target_clang_resource_dir_opt)) # Set up the host library environment. if hasattr(config, 'target_library_path_var'): @@ -3154,7 +3160,7 @@ def linux_get_os_release(): return os_id, os_release if platform.system() == 'Linux': - # Retrieve the Linux distro and version from `/etc/os-release`. + # Retrieve the Linux distro and version from `/etc/os-release`. (distributor, release) = linux_get_os_release() if distributor == '' or release == '': # If `/etc/os-release` does not provide full results, fallback to `lsb_release`. diff --git a/utils/swift_build_support/swift_build_support/products/wasisysroot.py b/utils/swift_build_support/swift_build_support/products/wasisysroot.py index 673051088ba..e73d50296dd 100644 --- a/utils/swift_build_support/swift_build_support/products/wasisysroot.py +++ b/utils/swift_build_support/swift_build_support/products/wasisysroot.py @@ -82,6 +82,10 @@ class WASILibc(product.Product): if not os.path.exists(dest_path): shell.symlink("wasm32-wasi", dest_path) + dest_path = os.path.join(sysroot_install_path, "lib", "wasip1") + if not os.path.exists(dest_path): + shell.symlink("wasi", dest_path) + @classmethod def get_dependencies(cls): return [llvm.LLVM]