diff --git a/stdlib/CMakeLists.txt b/stdlib/CMakeLists.txt index 81cad0966a1..edf7c19f4b7 100644 --- a/stdlib/CMakeLists.txt +++ b/stdlib/CMakeLists.txt @@ -38,6 +38,12 @@ else() set(SWIFT_STDLIB_STABLE_ABI_default FALSE) endif() +if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_INCLUDE_TESTS) + set(SWIFT_BUILD_TEST_SUPPORT_MODULES_default TRUE) +else() + set(SWIFT_BUILD_TEST_SUPPORT_MODULES_default FALSE) +endif() + # # User-configurable options for the standard library. # @@ -46,28 +52,32 @@ endif() # so that interfaces are emitted when overlays are separately built. option(SWIFT_STDLIB_STABLE_ABI - "Should stdlib be built with stable ABI (library evolution, resilience)." - "${SWIFT_STDLIB_STABLE_ABI_default}") + "Should stdlib be built with stable ABI (library evolution, resilience)." + "${SWIFT_STDLIB_STABLE_ABI_default}") option(SWIFT_ENABLE_MODULE_INTERFACES - "Generate .swiftinterface files alongside .swiftmodule files" - "${SWIFT_STDLIB_STABLE_ABI}") + "Generate .swiftinterface files alongside .swiftmodule files" + "${SWIFT_STDLIB_STABLE_ABI}") option(SWIFT_ENABLE_COMPATIBILITY_OVERRIDES - "Support back-deploying compatibility fixes for newer apps running on older runtimes." - TRUE) + "Support back-deploying compatibility fixes for newer apps running on older runtimes." + TRUE) option(SWIFT_RUNTIME_MACHO_NO_DYLD - "Build stdlib assuming the runtime environment uses Mach-O but does not support dynamic modules." - FALSE) + "Build stdlib assuming the runtime environment uses Mach-O but does not support dynamic modules." + FALSE) option(SWIFT_STDLIB_SINGLE_THREADED_RUNTIME - "Build the standard libraries assuming that they will be used in an environment with only a single thread." - FALSE) + "Build the standard libraries assuming that they will be used in an environment with only a single thread." + FALSE) option(SWIFT_STDLIB_OS_VERSIONING - "Build stdlib with availability based on OS versions (Darwin only)." - TRUE) + "Build stdlib with availability based on OS versions (Darwin only)." + TRUE) + +option(SWIFT_BUILD_TEST_SUPPORT_MODULES + "Whether to build StdlibUnittest and other test support modules. Defaults to On when SWIFT_BUILD_SDK_OVERLAY is On, or when SWIFT_INCLUDE_TESTS is On." + "${SWIFT_BUILD_TEST_SUPPORT_MODULES_default}") # # End of user-configurable options. diff --git a/stdlib/cmake/modules/AddSwiftStdlib.cmake b/stdlib/cmake/modules/AddSwiftStdlib.cmake index cbf16b98f06..01b29efb146 100644 --- a/stdlib/cmake/modules/AddSwiftStdlib.cmake +++ b/stdlib/cmake/modules/AddSwiftStdlib.cmake @@ -1438,6 +1438,9 @@ endfunction() # SWIFT_MODULE_DEPENDS_WATCHOS # Swift modules this library depends on when built for watchOS. # +# SWIFT_MODULE_DEPENDS_FREESTANDING +# Swift modules this library depends on when built for Freestanding. +# # SWIFT_MODULE_DEPENDS_FREEBSD # Swift modules this library depends on when built for FreeBSD. # @@ -1562,6 +1565,7 @@ function(add_swift_target_library name) SWIFT_MODULE_DEPENDS SWIFT_MODULE_DEPENDS_CYGWIN SWIFT_MODULE_DEPENDS_FREEBSD + SWIFT_MODULE_DEPENDS_FREESTANDING SWIFT_MODULE_DEPENDS_OPENBSD SWIFT_MODULE_DEPENDS_HAIKU SWIFT_MODULE_DEPENDS_IOS @@ -1719,6 +1723,9 @@ function(add_swift_target_library name) elseif(${sdk} STREQUAL WATCHOS OR ${sdk} STREQUAL WATCHOS_SIMULATOR) list(APPEND swiftlib_module_depends_flattened ${SWIFTLIB_SWIFT_MODULE_DEPENDS_WATCHOS}) + elseif(${sdk} STREQUAL FREESTANDING) + list(APPEND swiftlib_module_depends_flattened + ${SWIFTLIB_SWIFT_MODULE_DEPENDS_FREESTANDING}) elseif(${sdk} STREQUAL FREEBSD) list(APPEND swiftlib_module_depends_flattened ${SWIFTLIB_SWIFT_MODULE_DEPENDS_FREEBSD}) diff --git a/stdlib/private/CMakeLists.txt b/stdlib/private/CMakeLists.txt index b1cf2ed6b1b..1007fabd79b 100644 --- a/stdlib/private/CMakeLists.txt +++ b/stdlib/private/CMakeLists.txt @@ -8,6 +8,9 @@ if(SWIFT_BUILD_SDK_OVERLAY) if(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING) add_subdirectory(DifferentiationUnittest) endif() +endif() + +if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES) add_subdirectory(RuntimeUnittest) add_subdirectory(StdlibUnicodeUnittest) add_subdirectory(StdlibCollectionUnittest) @@ -18,7 +21,9 @@ if(SWIFT_BUILD_SDK_OVERLAY) # SwiftPrivateThreadExtras to ensure that the dependency targets are setup in # the correct order for Windows. add_subdirectory(StdlibUnittest) +endif() +if(SWIFT_BUILD_SDK_OVERLAY) add_subdirectory(OSLog) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") diff --git a/stdlib/private/StdlibUnittest/CMakeLists.txt b/stdlib/private/StdlibUnittest/CMakeLists.txt index 634d34b7198..0e033b97f13 100644 --- a/stdlib/private/StdlibUnittest/CMakeLists.txt +++ b/stdlib/private/StdlibUnittest/CMakeLists.txt @@ -36,6 +36,7 @@ add_swift_target_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} SWIFT_MODULE_DEPENDS_OSX Darwin Foundation SWIFT_MODULE_DEPENDS_TVOS Darwin Foundation SWIFT_MODULE_DEPENDS_WATCHOS Darwin Foundation + SWIFT_MODULE_DEPENDS_FREESTANDING Darwin SWIFT_MODULE_DEPENDS_LINUX Glibc SWIFT_MODULE_DEPENDS_FREEBSD Glibc SWIFT_MODULE_DEPENDS_OPENBSD Glibc diff --git a/stdlib/private/StdlibUnittest/StdlibUnittest.swift b/stdlib/private/StdlibUnittest/StdlibUnittest.swift index 4a1f89ddec2..7e6e82c4718 100644 --- a/stdlib/private/StdlibUnittest/StdlibUnittest.swift +++ b/stdlib/private/StdlibUnittest/StdlibUnittest.swift @@ -16,7 +16,9 @@ import SwiftPrivateThreadExtras import SwiftPrivateLibcExtras #if canImport(Darwin) +#if _runtime(_ObjC) import Foundation +#endif import Darwin #elseif canImport(Glibc) import Glibc @@ -1729,9 +1731,19 @@ public final class TestSuite { } #if canImport(Darwin) +#if _runtime(_ObjC) func _getSystemVersionPlistProperty(_ propertyName: String) -> String? { return NSDictionary(contentsOfFile: "/System/Library/CoreServices/SystemVersion.plist")?[propertyName] as? String } +#else +func _getSystemVersionPlistProperty(_ propertyName: String) -> String? { + var count = 0 + sysctlbyname("kern.osproductversion", nil, &count, nil, 0) + var s = [CChar](repeating: 0, count: count) + sysctlbyname("kern.osproductversion", &s, &count, nil, 0) + return String(cString: &s) +} +#endif #endif public enum OSVersion : CustomStringConvertible { diff --git a/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt b/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt index 887b4bab6f6..29a377932b9 100644 --- a/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt +++ b/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt @@ -13,6 +13,7 @@ add_swift_target_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUIL SWIFT_MODULE_DEPENDS_IOS Darwin SWIFT_MODULE_DEPENDS_TVOS Darwin SWIFT_MODULE_DEPENDS_WATCHOS Darwin + SWIFT_MODULE_DEPENDS_FREESTANDING Darwin SWIFT_MODULE_DEPENDS_LINUX Glibc SWIFT_MODULE_DEPENDS_FREEBSD Glibc SWIFT_MODULE_DEPENDS_OPENBSD Glibc diff --git a/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt b/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt index 0c9fefb71d6..e2c7b198ecb 100644 --- a/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt +++ b/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt @@ -10,6 +10,7 @@ add_swift_target_library(swiftSwiftPrivateThreadExtras ${SWIFT_STDLIB_LIBRARY_BU SWIFT_MODULE_DEPENDS_OSX Darwin SWIFT_MODULE_DEPENDS_TVOS Darwin SWIFT_MODULE_DEPENDS_WATCHOS Darwin + SWIFT_MODULE_DEPENDS_FREESTANDING Darwin SWIFT_MODULE_DEPENDS_LINUX Glibc SWIFT_MODULE_DEPENDS_FREEBSD Glibc SWIFT_MODULE_DEPENDS_OPENBSD Glibc @@ -17,7 +18,6 @@ add_swift_target_library(swiftSwiftPrivateThreadExtras ${SWIFT_STDLIB_LIBRARY_BU SWIFT_MODULE_DEPENDS_HAIKU Glibc SWIFT_MODULE_DEPENDS_WINDOWS CRT WinSDK SWIFT_COMPILE_FLAGS ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS} - TARGET_SDKS ALL_APPLE_PLATFORMS CYGWIN FREEBSD OPENBSD HAIKU LINUX WINDOWS ANDROID INSTALL_IN_COMPONENT stdlib-experimental DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}") diff --git a/stdlib/public/CMakeLists.txt b/stdlib/public/CMakeLists.txt index dd075308bd4..f32785db299 100644 --- a/stdlib/public/CMakeLists.txt +++ b/stdlib/public/CMakeLists.txt @@ -104,7 +104,7 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR) add_subdirectory(SwiftRemoteMirror) endif() -if(SWIFT_BUILD_SDK_OVERLAY) +if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES) add_subdirectory(Platform) endif() diff --git a/stdlib/public/Platform/CMakeLists.txt b/stdlib/public/Platform/CMakeLists.txt index 0d7adcd3b3e..c7e7bac1092 100644 --- a/stdlib/public/Platform/CMakeLists.txt +++ b/stdlib/public/Platform/CMakeLists.txt @@ -27,7 +27,7 @@ add_swift_target_library(swiftDarwin ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_ ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS} -Xfrontend -disable-objc-attr-requires-foundation-module LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}" - TARGET_SDKS ALL_APPLE_PLATFORMS + TARGET_SDKS ALL_APPLE_PLATFORMS FREESTANDING INSTALL_IN_COMPONENT sdk-overlay DEPENDS ${darwin_depends}) diff --git a/stdlib/public/Platform/MachError.swift b/stdlib/public/Platform/MachError.swift index 5d506dcefcb..d79fb7382a4 100644 --- a/stdlib/public/Platform/MachError.swift +++ b/stdlib/public/Platform/MachError.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) +#if (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && _runtime(_ObjC) /// Enumeration describing Mach error codes. @objc public enum MachErrorCode : Int32 { @@ -202,4 +202,4 @@ public enum MachErrorCode : Int32 { /// The requested property cannot be changed at this time. case policyStatic = 51 } -#endif // os(macOS) || os(iOS) || os(tvOS) || os(watchOS) +#endif // (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && _runtime(_ObjC) diff --git a/stdlib/public/Platform/POSIXError.swift b/stdlib/public/Platform/POSIXError.swift index 5e644ae7a72..fe981cc55d5 100644 --- a/stdlib/public/Platform/POSIXError.swift +++ b/stdlib/public/Platform/POSIXError.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) +#if (os(macOS) || os(iOS) || os(tvOS) || os(watchOS)) && _runtime(_ObjC) /// Enumeration describing POSIX error codes. @objc diff --git a/stdlib/public/runtime/Metadata.cpp b/stdlib/public/runtime/Metadata.cpp index 95a81dd885a..9f9f561cdc8 100644 --- a/stdlib/public/runtime/Metadata.cpp +++ b/stdlib/public/runtime/Metadata.cpp @@ -6059,3 +6059,8 @@ inline void _Atomic_storage<::PoolRange, 16>::_Unlock() const noexcept { } } #endif + +// Autolink with libc++, for cases where libswiftCore is linked statically. +#if defined(__MACH__) +asm(".linker_option \"-lc++\"\n"); +#endif // defined(__MACH__) diff --git a/stdlib/tools/CMakeLists.txt b/stdlib/tools/CMakeLists.txt index 471c392bb00..62b1fc33184 100644 --- a/stdlib/tools/CMakeLists.txt +++ b/stdlib/tools/CMakeLists.txt @@ -1,3 +1,5 @@ +# Keep in sync with test/CMakeLists.txt: swift-reflection-test is +# only used when testing dynamic stdlib. if(SWIFT_BUILD_DYNAMIC_STDLIB AND SWIFT_INCLUDE_TESTS) add_subdirectory(swift-reflection-test) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ede6aee79e7..faa72de8611 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -252,7 +252,9 @@ foreach(SDK ${SWIFT_SDKS}) set(test_dependencies) get_test_dependencies("${SDK}" test_dependencies) - if(SWIFT_BUILD_STDLIB AND SWIFT_INCLUDE_TESTS) + # Keep in sync with stdlib/tools/CMakeLists.txt: swift-reflection-test is + # only used when testing dynamic stdlib. + if(SWIFT_BUILD_DYNAMIC_STDLIB AND SWIFT_INCLUDE_TESTS) # NOTE create a stub BlocksRuntime library that can be used for the # reflection tests file(WRITE ${test_bin_dir}/Inputs/BlocksRuntime.c diff --git a/test/lit.cfg b/test/lit.cfg index 3e9bd53e1f6..09e2f38fada 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -850,6 +850,36 @@ if run_vendor == 'apple': config.available_features.add('foundation') config.available_features.add('objc_interop') + # The "freestanding" tests will link against the static libswiftCore.a and + # cannot use any of Obj-C / Dispatch / Foundation. + if "-freestanding" in config.variant_suffix: + config.target_runtime = "native" + config.available_features.remove('libdispatch') + config.available_features.remove('foundation') + config.available_features.remove('objc_interop') + config.available_features.add('freestanding') + + # Build all "freestanding" tests with -disable-objc-interop + swift_execution_tests_extra_flags += ' -Xfrontend -disable-objc-interop' + + # Link all "freestanding" tests with -dead_strip, which can effectively + # even remove parts of the stdlib and runtime, if it's not needed. Since + # it's a very desired behavior, let's enable it for all executable tests. + swift_execution_tests_extra_flags += ' -Xlinker -dead_strip' + + # Build a resource dir for freestanding tests. + new_resource_dir = os.path.join(config.test_exec_root, "resource_dir") + if not os.path.exists(new_resource_dir): os.mkdir(new_resource_dir) + def symlink_if_not_exists(src, dst): + src = os.path.join(test_resource_dir, src) + dst = os.path.join(new_resource_dir, dst) + if not os.path.exists(dst): os.symlink(src, dst) + symlink_if_not_exists("clang", "clang") + symlink_if_not_exists("shims", "shims") + symlink_if_not_exists("freestanding", "macosx") + resource_dir_opt = "-resource-dir %s" % new_resource_dir + lit_config.note('Using freestanding resource dir: ' + new_resource_dir) + xcrun_prefix = ( "xcrun --toolchain %s --sdk %r" % (config.darwin_xcrun_toolchain, config.variant_sdk)) diff --git a/test/stdlib/FlatMapDeprecation.swift b/test/stdlib/FlatMapDeprecation.swift index ee5545b8ca4..14202e45c82 100644 --- a/test/stdlib/FlatMapDeprecation.swift +++ b/test/stdlib/FlatMapDeprecation.swift @@ -1,4 +1,4 @@ -// RUN: %swift -swift-version 4 -typecheck -verify %s +// RUN: %target-typecheck-verify-swift -swift-version 4 func flatMapOnSequence< S : Sequence diff --git a/test/stdlib/NewStringAppending.swift b/test/stdlib/NewStringAppending.swift index bd58b838cfb..8d1f0568095 100644 --- a/test/stdlib/NewStringAppending.swift +++ b/test/stdlib/NewStringAppending.swift @@ -1,5 +1,6 @@ // RUN: %target-run-stdlib-swift | %FileCheck %s // REQUIRES: executable_test +// REQUIRES: foundation // // Parts of this test depend on memory allocator specifics. The test // should be rewritten soon so it doesn't expose legacy components diff --git a/test/stdlib/OSLogExecutionTest.swift b/test/stdlib/OSLogExecutionTest.swift index b415579f6ea..9aff68ade3b 100644 --- a/test/stdlib/OSLogExecutionTest.swift +++ b/test/stdlib/OSLogExecutionTest.swift @@ -7,6 +7,7 @@ // RUN: %target-codesign %t/OSLogExecutionTest // RUN: %target-run %t/OSLogExecutionTest // REQUIRES: executable_test +// REQUIRES: foundation // // REQUIRES: VENDOR=apple diff --git a/test/stdlib/Runtime.swift.gyb b/test/stdlib/Runtime.swift.gyb index ca9e81d3e6a..072515203b9 100644 --- a/test/stdlib/Runtime.swift.gyb +++ b/test/stdlib/Runtime.swift.gyb @@ -591,6 +591,7 @@ Runtime.test("Struct layout with reference storage types") { print(malkovich) } +#if !(canImport(Darwin) && !_runtime(_ObjC)) Runtime.test("SwiftError layout constants for LLDB") { let offsetof_SwiftError_typeMetadata = pointerToSwiftCoreSymbol(name: "_swift_lldb_offsetof_SwiftError_typeMetadata")! let sizeof_SwiftError = pointerToSwiftCoreSymbol(name: "_swift_lldb_sizeof_SwiftError")! @@ -610,6 +611,7 @@ Runtime.test("SwiftError layout constants for LLDB") { _UnimplementedError() #endif } +#endif var Reflection = TestSuite("Reflection") @@ -762,7 +764,7 @@ AvailabilityVersionsTestSuite.test("_stdlib_isOSVersionAtLeast") { // _stdlib_isOSVersionAtLeast is broken for // watchOS. rdar://problem/20234735 -#if canImport(Darwin) +#if canImport(Darwin) && _runtime(_ObjC) // This test assumes that no version component on an OS we test upon // will ever be greater than 1066 and that every major version will always // be greater than 1. diff --git a/test/stdlib/UnsafePointerDiagnostics.swift b/test/stdlib/UnsafePointerDiagnostics.swift index b41e5401218..83fdb85d734 100644 --- a/test/stdlib/UnsafePointerDiagnostics.swift +++ b/test/stdlib/UnsafePointerDiagnostics.swift @@ -1,4 +1,4 @@ -// RUN: %target-typecheck-verify-swift -enable-invalid-ephemeralness-as-error +// RUN: %target-typecheck-verify-swift -enable-invalid-ephemeralness-as-error -disable-objc-interop // Test availability attributes on UnsafePointer initializers. // Assume the original source contains no UnsafeRawPointer types. diff --git a/test/stdlib/UnsafePointerDiagnostics_warning.swift b/test/stdlib/UnsafePointerDiagnostics_warning.swift index 180f12d0d89..ead8ac23a0d 100644 --- a/test/stdlib/UnsafePointerDiagnostics_warning.swift +++ b/test/stdlib/UnsafePointerDiagnostics_warning.swift @@ -1,4 +1,4 @@ -// RUN: %target-typecheck-verify-swift +// RUN: %target-typecheck-verify-swift -disable-objc-interop // Test that we get a custom diagnostic for an ephemeral conversion to non-ephemeral param for an Unsafe[Mutable][Raw][Buffer]Pointer init. func unsafePointerInitEphemeralConversions() { diff --git a/test/stdlib/VarArgs.swift b/test/stdlib/VarArgs.swift index feda99a9d95..4407f4c355e 100644 --- a/test/stdlib/VarArgs.swift +++ b/test/stdlib/VarArgs.swift @@ -3,9 +3,17 @@ import Swift -#if _runtime(_ObjC) +#if canImport(Darwin) import Darwin - import CoreGraphics + #if _runtime(_ObjC) + import CoreGraphics + #else + #if arch(x86_64) || arch(arm64) + typealias CGFloat = Double + #else + typealias CGFloat = Float + #endif + #endif #elseif canImport(Glibc) import Glibc typealias CGFloat = Double diff --git a/test/stdlib/llvm-support-odr-violation.test-sh b/test/stdlib/llvm-support-odr-violation.test-sh index 3621136b105..085f816f2da 100644 --- a/test/stdlib/llvm-support-odr-violation.test-sh +++ b/test/stdlib/llvm-support-odr-violation.test-sh @@ -1,2 +1,3 @@ // RUN: %llvm-nm --defined-only -C %platform-dylib-dir/%target-library-name(swiftCore) | %FileCheck --allow-empty %s // CHECK-NOT: [^:]llvm:: +// UNSUPPORTED: freestanding diff --git a/test/stdlib/symbol-visibility-darwin.test-sh b/test/stdlib/symbol-visibility-darwin.test-sh index e0ddc648fe7..8c6bb2588c7 100644 --- a/test/stdlib/symbol-visibility-darwin.test-sh +++ b/test/stdlib/symbol-visibility-darwin.test-sh @@ -19,3 +19,4 @@ // symbols are handled properly. // REQUIRES: VENDOR=apple +// UNSUPPORTED: freestanding diff --git a/test/stdlib/tgmath.swift.gyb b/test/stdlib/tgmath.swift.gyb index f4ad32701e4..8080936bcbe 100644 --- a/test/stdlib/tgmath.swift.gyb +++ b/test/stdlib/tgmath.swift.gyb @@ -176,7 +176,7 @@ internal extension TGMath { % if T == 'Float80': #if (arch(i386) || arch(x86_64)) && !os(Windows) % elif T == 'CGFloat': -#if canImport(CoreGraphics) +#if _runtime(_ObjC) && canImport(CoreGraphics) import CoreGraphics % end diff --git a/utils/build-presets.ini b/utils/build-presets.ini index dc3826f228a..27bbeb7fb5f 100644 --- a/utils/build-presets.ini +++ b/utils/build-presets.ini @@ -2344,6 +2344,13 @@ swift-freestanding-triple-name=macosx11.0 swift-freestanding-module-name=macos swift-freestanding-archs=x86_64 +[preset: stdlib_S_standalone_minimal_macho_x86_64,build,test] +mixin-preset=stdlib_S_standalone_minimal_macho_x86_64,build + +test +validation-test + + #===----------------------------------------------------------------------===# # Preset for Source Compatibility Suite #===----------------------------------------------------------------------===# diff --git a/validation-test/stdlib/POSIXErrorCode.swift b/validation-test/stdlib/POSIXErrorCode.swift index af6f72f9d31..db9ba066643 100644 --- a/validation-test/stdlib/POSIXErrorCode.swift +++ b/validation-test/stdlib/POSIXErrorCode.swift @@ -1,6 +1,7 @@ // RUN: %target-run-simple-swift // REQUIRES: executable_test // REQUIRES: VENDOR=apple || OS=linux-androideabi || OS=linux-android || OS=linux-gnu +// UNSUPPORTED: freestanding import Swift import StdlibUnittest diff --git a/validation-test/stdlib/String.swift b/validation-test/stdlib/String.swift index d2e35647dca..8d75aad4fa0 100644 --- a/validation-test/stdlib/String.swift +++ b/validation-test/stdlib/String.swift @@ -6,6 +6,7 @@ // RUN: %target-run %t/String // REQUIRES: executable_test // XFAIL: interpret +// UNSUPPORTED: freestanding // With a non-optimized stdlib the test takes very long. // REQUIRES: optimized_stdlib diff --git a/validation-test/stdlib/StringUTF8.swift b/validation-test/stdlib/StringUTF8.swift index cc7db95bcf3..acba86f120f 100644 --- a/validation-test/stdlib/StringUTF8.swift +++ b/validation-test/stdlib/StringUTF8.swift @@ -6,6 +6,7 @@ // RUN: %target-run %t/String // REQUIRES: executable_test // XFAIL: interpret +// UNSUPPORTED: freestanding import StdlibUnittest import StdlibCollectionUnittest