Fix/xfail/disable remaining tests for embedded Wasm

This commit is contained in:
Max Desiatov
2025-06-24 17:24:55 +01:00
parent b10da622e9
commit 27e5d5c551
49 changed files with 97 additions and 85 deletions

View File

@@ -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.

View File

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

View File

@@ -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"()

View File

@@ -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"{{.*}} {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -18,4 +18,4 @@ struct Main {
}
}
// CHECK: define {{.*}}@main(
// CHECK: define {{.*}}@{{_*}}main{{.*}}(

View File

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

View File

@@ -16,4 +16,4 @@ public class MyClass<T> {
}
}
// CHECK: define {{.*}}@main(
// CHECK: define {{.*}}@{{_*}}main{{.*}}(

View File

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

View File

@@ -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{{.*}}(

View File

@@ -51,4 +51,4 @@ public struct S<T> {
}
}
// CHECK: define {{.*}}@main(
// CHECK: define {{.*}}@{{_*}}main{{.*}}(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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)

View File

@@ -15,4 +15,4 @@ public func baz<T>(n: T) {
let x: ContiguousArray<Int> = .init(repeating: 0, count: 1)
}
// CHECK: define {{.*}}@main(
// CHECK: define {{.*}}@{{_*}}main{{.*}}(

View File

@@ -11,4 +11,4 @@ public func foo() {
func bar(_: UnsafePointer<UInt?>) {
}
// CHECK: define {{.*}}@main(
// CHECK: define {{.*}}@{{_*}}main{{.*}}(

View File

@@ -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{{.*}}

View File

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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

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

View File

@@ -6,6 +6,7 @@
// REQUIRES: CODEGENERATOR=RISCV
// REQUIRES: embedded_stdlib_cross_compiling
// REQUIRES: swift_feature_Embedded
// UNSUPPORTED: OS=wasi
class MyClass {}

View File

@@ -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)

View File

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

View File

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

View File

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

View File

@@ -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")
@@ -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'):

View File

@@ -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]