mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #83128 from MaxDesiatov/maxd/run-embedded-tests
test/CMakeLists.txt: run Embedded Swift for Wasm tests Run new `check-swift-embedded-wasi` target from `test/CMakeLists.txt`, tweak `lit.cfg` to support WASI Clang resource dir, exclude unsupported tests based on `CPU=wasm32` instead of `OS=wasi`.
This commit is contained in:
@@ -404,6 +404,14 @@ foreach(SDK ${SWIFT_SDKS})
|
||||
set(VARIANT_EXTERNAL_EMBEDDED_PLATFORM FALSE)
|
||||
set(VARIANT_EXTERNAL_EMBEDDED_DEVICE)
|
||||
|
||||
# Reset these values for WASI, as Embedded Swift for WASI requires separate lit configs.
|
||||
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_old ${SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB})
|
||||
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING_old ${SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING})
|
||||
if(${SDK} STREQUAL "WASI")
|
||||
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB OFF)
|
||||
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING OFF)
|
||||
endif()
|
||||
|
||||
swift_configure_lit_site_cfg(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in"
|
||||
"${test_bin_dir}/lit.site.cfg"
|
||||
@@ -426,6 +434,10 @@ foreach(SDK ${SWIFT_SDKS})
|
||||
"${test_bin_dir}/lit.swift-features.cfg"
|
||||
"${validation_test_bin_dir}/lit.swift-features.cfg")
|
||||
|
||||
# Restore old values in case they were reset for WASI tests lit configs.
|
||||
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB ${SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_old})
|
||||
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING ${SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING_old})
|
||||
|
||||
set(test_dependencies)
|
||||
get_test_dependencies("${SDK}" test_dependencies)
|
||||
|
||||
@@ -587,6 +599,43 @@ foreach(SDK ${SWIFT_SDKS})
|
||||
PROPERTY FOLDER "Tests/check-swift")
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING AND (${ARCH} STREQUAL "wasm32"))
|
||||
set(test_mode "optimize_none")
|
||||
set(test_subset "primary")
|
||||
set(VARIANT_SUFFIX "-embedded-wasi")
|
||||
set(VARIANT_TRIPLE "wasm32-unknown-wasip1")
|
||||
set(test_bin_dir "${CMAKE_CURRENT_BINARY_DIR}${VARIANT_SUFFIX}/embedded")
|
||||
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")
|
||||
|
||||
set(test_target_name "check-swift${VARIANT_SUFFIX}")
|
||||
set(directories "${test_bin_dir}")
|
||||
|
||||
set(embedded_wasm_lit_args)
|
||||
setup_lit_args(embedded_wasm_lit_args "${SDK}" "${SWIFT_TEST_RESULTS_DIR}" "${SWIFTLIB_DIR}")
|
||||
|
||||
add_custom_target("${test_target_name}"
|
||||
${maybe_command_upload_stdlib}
|
||||
${command_upload_swift_reflection_test}
|
||||
${command_clean_test_results_dir}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E env ${SWIFT_LIT_ENVIRONMENT}
|
||||
$<TARGET_FILE:Python3::Interpreter> "${LIT}"
|
||||
${embedded_wasm_lit_args}
|
||||
"--param" "swift_test_subset=${test_subset}"
|
||||
"--param" "swift_test_mode=${test_mode}"
|
||||
${directories}
|
||||
DEPENDS ${dependencies}
|
||||
COMMENT "Running ${test_subset} Swift tests for ${VARIANT_TRIPLE}"
|
||||
USES_TERMINAL)
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endforeach()
|
||||
@@ -624,17 +673,6 @@ 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")
|
||||
endif()
|
||||
|
||||
# Add shortcuts for the default variant.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// UNSUPPORTED: OS=windows-msvc
|
||||
|
||||
// `setjmp` is not available on WebAssembly/WASI
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
// https://github.com/apple/swift/issues/51632
|
||||
// In Android jmp_buf is int[16], which doesn't convert to &Int
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// UNSUPPORTED: back_deploy_concurrency
|
||||
// UNSUPPORTED: use_os_stdlib
|
||||
// UNSUPPORTED: freestanding
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
// REQUIRES: concurrency_runtime
|
||||
// UNSUPPORTED: back_deployment_runtime
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
// UNSUPPORTED: back_deploy_concurrency
|
||||
|
||||
// This test makes sure that:
|
||||
@@ -365,7 +365,7 @@ struct Runner {
|
||||
debugLog("==> Enter callee2")
|
||||
debugLog("==> Exit callee2")
|
||||
}
|
||||
|
||||
|
||||
// We add an inline never here to make sure that we do not eliminate
|
||||
// the dynamic access after inlining.
|
||||
@MainActor
|
||||
@@ -374,7 +374,7 @@ struct Runner {
|
||||
debugLog("==> Enter callee1")
|
||||
let handle = Task { @MainActor in
|
||||
debugLog("==> Enter callee1 Closure")
|
||||
|
||||
|
||||
// These accesses end before we await in the task.
|
||||
do {
|
||||
callee2(&global1, &global2, &global3)
|
||||
@@ -389,7 +389,7 @@ struct Runner {
|
||||
await handle.value
|
||||
debugLog("==> Exit callee1")
|
||||
}
|
||||
|
||||
|
||||
debugLog("==> Enter 'testCase1'")
|
||||
await callee1()
|
||||
debugLog("==> Exit 'testCase1'")
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// UNSUPPORTED: back_deploy_concurrency
|
||||
|
||||
// Crash expectations can't be implemented on WASI/WebAssembly.
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
// This test makes sure that we properly save/restore access when we
|
||||
// synchronously launch a task from a serial executor. The access from the task
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
// REQUIRES: concurrency
|
||||
|
||||
// WASI does not support the mandatory tail call, and needs to take the same
|
||||
// Wasm does not support the mandatory tail call, and needs to take the same
|
||||
// path as CHECK-WIN, but will currently go down CHECK-SYSV, failing the test.
|
||||
// XFAIL: OS=wasi
|
||||
// XFAIL: CPU=wasm32
|
||||
|
||||
sil_stage canonical
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
|
||||
|
||||
// wasm currently disables aggressive reg2mem
|
||||
// UNSUPPORTED: wasm
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
|
||||
public struct LargeThing {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// RUN: %target-swift-frontend %s -Xllvm -sil-print-types -Xllvm -sil-print-after=loadable-address -import-objc-header %S/Inputs/large_c.h -c -o %t/t.o 2>&1 | %FileCheck %s
|
||||
|
||||
// wasm currently disables aggressive reg2mem
|
||||
// UNSUPPORTED: wasm
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: PTRSIZE=64
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
// REQUIRES: swift_feature_BuiltinModule
|
||||
|
||||
// wasm currently disables aggressive reg2mem
|
||||
// UNSUPPORTED: wasm
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
|
||||
import Builtin
|
||||
|
||||
@@ -91,8 +91,6 @@
|
||||
// REQUIRES: concurrency_runtime
|
||||
|
||||
// TODO: CoroutineAccessors: Enable on WASM.
|
||||
// UNSUPPORTED: wasm
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
|
||||
// REQUIRES: swift_feature_CoroutineAccessors
|
||||
@@ -243,7 +241,7 @@ struct Boxtional<T> : ResilientWrapping {
|
||||
|
||||
@available(SwiftStdlib 9999, *)
|
||||
class NonresilientResilientWrappingSubclass<X : ResilientWrapping> : ResilientWrappingClass<X.Wrapped> {
|
||||
init(_ impl: X) {
|
||||
init(_ impl: X) {
|
||||
self.impl = impl
|
||||
super.init()
|
||||
}
|
||||
|
||||
@@ -4,7 +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
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
|
||||
@@ -1,7 +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
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: swift_feature_Embedded
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -parse-as-library -enable-experimental-feature Embedded -enable-experimental-feature Extern %s -c -o %t/a.o
|
||||
|
||||
// RUN: grep DEP\: %s | sed 's#// DEP\: ##' | sort > %t/allowed-dependencies.txt
|
||||
// RUN: if [[ %target-os =~ "wasi" ]]; then pattern="DEP\:\|DEP-WASM\:"; else pattern="DEP\:"; fi; grep "$pattern" %s | sed "s#// .*\: ##" | sort > %t/allowed-dependencies.txt
|
||||
|
||||
// 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: if [ %target-os == "linux-gnu" ] || [[ %target-os =~ "wasi" ]]; then sed -E -i -e 's/^_(.*)$/\1/' %t/allowed-dependencies.txt; fi
|
||||
|
||||
// RUN: %llvm-nm --undefined-only --format=just-symbols %t/a.o | sort | tee %t/actual-dependencies.txt
|
||||
|
||||
// Fail if there is any entry in actual-dependencies.txt that's not in allowed-dependencies.txt
|
||||
// RUN: test -z "`comm -13 %t/allowed-dependencies.txt %t/actual-dependencies.txt`"
|
||||
|
||||
// DEP-WASM: ___indirect_function_table
|
||||
// DEP-WASM: ___memory_base
|
||||
// DEP: ___stack_chk_fail
|
||||
// DEP: ___stack_chk_guard
|
||||
// DEP-WASM: ___stack_pointer
|
||||
// DEP: _arc4random_buf
|
||||
// DEP: _free
|
||||
// DEP: _memmove
|
||||
|
||||
@@ -4,7 +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
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
|
||||
@@ -1,7 +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
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
// REQUIRES: embedded_stdlib_cross_compiling
|
||||
|
||||
@@ -3,7 +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
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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
|
||||
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// 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
|
||||
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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
|
||||
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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
|
||||
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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
|
||||
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
// REQUIRES: embedded_stdlib_cross_compiling
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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
|
||||
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: embedded_stdlib_cross_compiling
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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
|
||||
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: embedded_stdlib_cross_compiling
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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
|
||||
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// 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
|
||||
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
// REQUIRES: embedded_stdlib_cross_compiling
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// RUN: %target-swift-frontend -target riscv32-none-none-eabi -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -target riscv64-none-none-eabi -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
|
||||
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: CODEGENERATOR=RISCV
|
||||
// REQUIRES: embedded_stdlib_cross_compiling
|
||||
// REQUIRES: swift_feature_Embedded
|
||||
// UNSUPPORTED: OS=wasi
|
||||
|
||||
class MyClass {}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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
|
||||
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: CODEGENERATOR=ARM
|
||||
|
||||
@@ -4,7 +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
|
||||
// XFAIL: CPU=wasm32
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: swift_stdlib_no_asserts
|
||||
|
||||
14
test/lit.cfg
14
test/lit.cfg
@@ -409,10 +409,10 @@ if run_vers.endswith('-simulator'):
|
||||
else:
|
||||
run_environment=''
|
||||
|
||||
# Don't distinguish between wasi, wasip1, and so on to use OS=wasi condition in
|
||||
# the test suites.
|
||||
if run_os.startswith('wasi'):
|
||||
run_os = 'wasi'
|
||||
# Allow using using same condition in WASI test suites.
|
||||
kIsWASI = run_os.startswith('wasi')
|
||||
if kIsWASI:
|
||||
run_os = f"{run_os}{run_vers}"
|
||||
|
||||
# Parse the host triple
|
||||
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
|
||||
@@ -2055,7 +2055,7 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android':
|
||||
'-L%s' % make_path(test_resource_dir, config.target_sdk_name)])
|
||||
# The Swift interpreter is not available when targeting Android.
|
||||
config.available_features.discard('swift_interpreter')
|
||||
elif run_os == 'wasi':
|
||||
elif kIsWASI:
|
||||
lit_config.note("Testing WebAssembly/WASI " + config.variant_triple)
|
||||
|
||||
config.target_object_format = "wasm"
|
||||
@@ -2064,7 +2064,7 @@ elif run_os == 'wasi':
|
||||
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_clang_resource_dir_opt = f"-resource-dir {test_resource_dir}/../../../wasi-sysroot/wasm32-wasip1"
|
||||
|
||||
config.target_swift_autolink_extract = inferSwiftBinary("swift-autolink-extract")
|
||||
|
||||
@@ -2651,7 +2651,7 @@ if run_vendor != 'apple':
|
||||
|
||||
if 'remote_run_host' in lit_config.params:
|
||||
configure_remote_run()
|
||||
elif not kIsWindows and not run_os == 'wasi':
|
||||
elif not kIsWindows and not kIsWASI:
|
||||
if 'use_os_stdlib' in lit_config.params:
|
||||
config.available_features.add('use_os_stdlib')
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// RUN: %target-run %t/a.out_Debug
|
||||
// RUN: %target-run %t/a.out_Release
|
||||
// REQUIRES: executable_test
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// RUN: %target-run %t/a.out_Debug
|
||||
// RUN: %target-run %t/a.out_Release
|
||||
// REQUIRES: executable_test
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// RUN: %target-run-simple-swiftgyb
|
||||
// REQUIRES: executable_test
|
||||
// UNSUPPORTED: freestanding
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// RUN: %target-run %t/a.out_Debug
|
||||
// RUN: %target-run %t/a.out_Release
|
||||
// REQUIRES: executable_test
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// RUN: %target-run %t/Assert_Release
|
||||
// RUN: %target-run %t/Assert_Unchecked
|
||||
// REQUIRES: executable_test
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
@@ -77,7 +77,7 @@ OptionalTraps.test("UnwrapNone/Message")
|
||||
reason: "this trap may not have an error message may not be printed in -O"))
|
||||
.code {
|
||||
var a: AnyObject? = returnNil()
|
||||
expectCrashLater(withMessage:
|
||||
expectCrashLater(withMessage:
|
||||
"Unexpectedly found nil while unwrapping an Optional value")
|
||||
let unwrapped: AnyObject = a!
|
||||
_blackHole(unwrapped)
|
||||
@@ -92,7 +92,7 @@ OptionalTraps.test("UnwrapNone/Message/Implicit")
|
||||
reason: "this trap may not have an error message may not be printed in -O"))
|
||||
.code {
|
||||
var a: AnyObject! = returnNil()
|
||||
expectCrashLater(withMessage:
|
||||
expectCrashLater(withMessage:
|
||||
"Unexpectedly found nil while implicitly unwrapping an Optional value")
|
||||
let unwrapped: AnyObject = a
|
||||
_blackHole(unwrapped)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %target-run-simple-swift %t
|
||||
// REQUIRES: executable_test
|
||||
// UNSUPPORTED: OS=windows-msvc
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
// UNSUPPORTED: OS=freebsd
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// RUN: %target-run %t/a.out_Debug
|
||||
// RUN: %target-run %t/a.out_Release
|
||||
// REQUIRES: executable_test
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
|
||||
import StdlibUnittest
|
||||
@@ -34,7 +34,7 @@ RangeTraps.test("HalfOpen")
|
||||
.code {
|
||||
var range = 1..<1
|
||||
expectType(CountableRange<Int>.self, &range)
|
||||
|
||||
|
||||
expectCrashLater()
|
||||
_ = 1..<0
|
||||
}
|
||||
@@ -67,7 +67,7 @@ RangeTraps.test("CountablePartialRangeFrom")
|
||||
{ _isFastAssertConfiguration() },
|
||||
reason: "this trap is not guaranteed to happen in -Ounchecked"))
|
||||
.code {
|
||||
|
||||
|
||||
let range = (Int.max - 1)...
|
||||
var it = range.makeIterator()
|
||||
_ = it.next()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// RUN: %target-run %t/a.out_Debug
|
||||
// RUN: %target-run %t/a.out_Release
|
||||
// REQUIRES: executable_test
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
import StdlibUnittest
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// 5.7 so that we can test new behavior even if the SDK we're using predates it.
|
||||
|
||||
// REQUIRES: executable_test
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
import StdlibUnittest
|
||||
#if _runtime(_ObjC)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %target-swift-frontend -typecheck -swift-version 6 %s -verify
|
||||
// REQUIRES: executable_test
|
||||
// REQUIRES: OS=wasi
|
||||
// REQUIRES: OS=wasip1
|
||||
|
||||
import WASILibc
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %target-run-simple-swift %t
|
||||
// REQUIRES: executable_test
|
||||
// UNSUPPORTED: OS=windows-msvc
|
||||
// UNSUPPORTED: OS=wasi
|
||||
// UNSUPPORTED: OS=wasip1
|
||||
|
||||
import StdlibUnittest
|
||||
#if canImport(Darwin)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// FIXME: No simd module on linux rdar://problem/20795411
|
||||
// XFAIL: OS=linux-gnu, OS=windows-msvc, OS=openbsd, OS=linux-android, OS=linux-androideabi, OS=freebsd
|
||||
// XFAIL: OS=wasi
|
||||
// XFAIL: CPU=wasm32
|
||||
|
||||
import simd
|
||||
|
||||
|
||||
@@ -213,6 +213,9 @@ class WasmStdlib(cmake_product.CMakeProduct):
|
||||
self.cmake_options.define('SWIFT_THREADING_PACKAGE:STRING', 'none')
|
||||
|
||||
def test(self, host_target):
|
||||
self._test(host_target, 'wasm32-wasip1')
|
||||
|
||||
def _test(self, host_target, target_triple):
|
||||
build_root = os.path.dirname(self.build_dir)
|
||||
bin_paths = [
|
||||
os.path.join(self._host_swift_build_dir(host_target), 'bin'),
|
||||
@@ -234,7 +237,14 @@ class WasmStdlib(cmake_product.CMakeProduct):
|
||||
'LIT_FILTER_OUT':
|
||||
'(Concurrency/Runtime/clock.swift|stdlib/StringIndex.swift)',
|
||||
}
|
||||
self.test_with_cmake(None, [test_target], self._build_variant, [], test_env=env)
|
||||
|
||||
# Embedded stdlib is not built for the threads triple, don't include embedded tests for it.
|
||||
if target_triple == 'wasm32-wasip1-threads':
|
||||
test_targets = [test_target]
|
||||
else:
|
||||
test_targets = [test_target, 'check-swift-embedded-wasi']
|
||||
|
||||
self.test_with_cmake(None, test_targets, self._build_variant, [], test_env=env)
|
||||
|
||||
def should_test_executable(self) -> bool:
|
||||
return True
|
||||
@@ -271,6 +281,9 @@ class WasmThreadsStdlib(WasmStdlib):
|
||||
def build(self, host_target):
|
||||
self._build(host_target, 'wasm32-wasip1-threads', 'wasip1-threads-wasm32')
|
||||
|
||||
def test(self, host_target):
|
||||
self._test(host_target, 'wasm32-wasip1-threads')
|
||||
|
||||
def should_test_executable(self):
|
||||
# TODO(katei): Enable tests once WasmKit supports WASI threads
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user