Skip to content

Enable more tests for Embedded Wasm #82399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions test/embedded/array-builtins-exec.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -41,7 +39,7 @@ func exerciseArrayValueWitnesses<T>(_ 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)
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/basic-modules-generics-no-stdlib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public func main() {
protocolBoundFunc(GenericType<Bool>(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"()
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/basic-modules-no-stdlib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"{{.*}} {
Expand Down
1 change: 1 addition & 0 deletions test/embedded/builtin-float.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// 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

// UNSUPPORTED: OS=wasi
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: CODEGENERATOR=ARM
Expand Down
6 changes: 2 additions & 4 deletions test/embedded/classes-arrays.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -56,7 +54,7 @@ struct Main {
// CHECK: MySubSubClass.foo
}
print("")

print("5") // CHECK: 5
objects = []
// CHECK: MyClass.deinit
Expand Down
1 change: 1 addition & 0 deletions test/embedded/classes-generic-no-stdlib.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// RUN: %target-swift-emit-sil %s -parse-stdlib -enable-experimental-feature Embedded -target arm64e-apple-none -wmo | %FileCheck %s --check-prefix CHECK-SIL
// RUN: %target-swift-emit-ir %s -parse-stdlib -enable-experimental-feature Embedded -target arm64e-apple-none -wmo | %FileCheck %s --check-prefix CHECK-IR

// UNSUPPORTED: OS=wasi
// REQUIRES: swift_in_compiler
// REQUIRES: swift_feature_Embedded

Expand Down
4 changes: 2 additions & 2 deletions test/embedded/classes-multi-module.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,7 +28,7 @@ class X<T: BinaryInteger> {
var x: T

init(x: T) { self.x = x }

func bar() {
print(x)
}
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/classes-optional.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/embedded/classes-stack-promotion.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/embedded/classes.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -84,7 +84,7 @@ struct Main {
// CHECK: MySubClass.foo
// CHECK: MySubSubClass.foo
print("")

print("5") // CHECK: 5
o.0 = nil
// CHECK: MyClass.deinit
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/closures-heap.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/concurrency-simple.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the change from %target-cpu-apple-macos to %target-triple still actually work and pass in CI? If yes, then great, but I think I remember that I had to use the former because for macOS, %target-triple includes the version number and that's not in the directory name...

// RUN: %target-run %t/a.out | %FileCheck %s

// REQUIRES: executable_test
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/custom-print.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/deinit-release.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/deinit-release2.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 6 additions & 3 deletions test/embedded/dependencies-random.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/dynamic-self.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ struct Main {
}
}

// CHECK: define {{.*}}@main(
// CHECK: define {{.*}}@{{_*}}main{{.*}}(
2 changes: 1 addition & 1 deletion test/embedded/extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/embedded/failable-crash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public class MyClass<T> {
}
}

// CHECK: define {{.*}}@main(
// CHECK: define {{.*}}@{{_*}}main{{.*}}(
1 change: 1 addition & 0 deletions test/embedded/float-abi-hard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion test/embedded/fragile-reference.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// 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

// UNSUPPORTED: OS=wasi
// REQUIRES: swift_in_compiler
// REQUIRES: CODEGENERATOR=ARM
// REQUIRES: embedded_stdlib_cross_compiling
Expand All @@ -17,5 +19,5 @@ enum MyEnum: UInt8 {
case a = 0
}

// CHECK: define {{.*}}@main(
// CHECK: define {{.*}}@{{_*}}main{{.*}}(

2 changes: 1 addition & 1 deletion test/embedded/hello.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: OS=macosx || OS=linux-gnu || OS=none-eabi || OS=none-elf
// REQUIRES: OS=macosx || OS=linux-gnu || OS=none-eabi || OS=none-elf || OS=wasi
// REQUIRES: swift_feature_Embedded

print("Hello, Embedded Swift!")
Expand Down
4 changes: 2 additions & 2 deletions test/embedded/keypath-crash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public struct Binding<Value> {

public struct State<Wrapped> {
public var wrappedValue: Wrapped

public init(wrappedValue: Wrapped) {
self.wrappedValue = wrappedValue
}
Expand Down Expand Up @@ -51,4 +51,4 @@ public struct S<T> {
}
}

// CHECK: define {{.*}}@main(
// CHECK: define {{.*}}@{{_*}}main{{.*}}(
2 changes: 1 addition & 1 deletion test/embedded/linkage-mergeable-dead-strip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/embedded/linkage-mergeable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/linkage-mergeable2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/linkage-mergeable3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/linkage-mergeable4.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/lit.local.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if 'embedded_stdlib' not in config.available_features:
config.unsupported = True

# (3) Restrict Embedded Swift tests only to the currently supported set of test target OS's, skip them otherwise.
supported_test_os_list = ["OS=macosx", "OS=linux-gnu", "OS=none-eabi", "OS=none-elf"]
supported_test_os_list = ["OS=macosx", "OS=linux-gnu", "OS=none-eabi", "OS=none-elf", "OS=wasi"]
if config.available_features.intersection(set(supported_test_os_list)) == set():
config.unsupported = True

Expand Down
2 changes: 1 addition & 1 deletion test/embedded/modules-empty-object.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/embedded/modules-used2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/embedded/no-allocations-print.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// 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

// UNSUPPORTED: OS=wasi
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: CODEGENERATOR=ARM
Expand Down
8 changes: 4 additions & 4 deletions test/embedded/once-dependent.swift
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@

public struct MyStructA {
static var singleton = MyStructA()

init() {
print("MyStructA.init")
_ = MyStructB.singleton
Expand All @@ -19,7 +19,7 @@ public struct MyStructA {

public struct MyStructB {
static var singleton = MyStructB()

init() {
print("MyStructB.init")
_ = MyStructC.singleton
Expand All @@ -29,7 +29,7 @@ public struct MyStructB {

public struct MyStructC {
static var singleton = MyStructC()

init() {
print("MyStructC.init")
print("MyStructC.init done")
Expand Down
Loading