diff --git a/include/swift/AST/DiagnosticsFrontend.def b/include/swift/AST/DiagnosticsFrontend.def index 903c73bc5bed2..026a9b5620e66 100644 --- a/include/swift/AST/DiagnosticsFrontend.def +++ b/include/swift/AST/DiagnosticsFrontend.def @@ -24,6 +24,13 @@ WARNING(warning_no_such_sdk,none, "no such SDK: '%0'", (StringRef)) +WARNING(warning_no_resource_dir_in_sdk, none, + "You passed in an external -sdk without a Swift runtime.\n" + " Either specify a directory containing the runtime libraries with\n" + " the -resource-dir flag, or use -sysroot instead to point at a C/C++\n" + " sysroot alone. Falling back to this path for the Swift runtime modules\n" + " and libraries:\n" + " %0", (StringRef)) ERROR(error_no_frontend_args, none, "no arguments provided to '-frontend'", ()) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 70664b4b7ba56..327bdb9e148f7 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -768,8 +768,8 @@ void importer::getNormalInvocationArguments( invocationArgStrs.push_back("-fapinotes-swift-version=" + languageVersion.asAPINotesVersionString()); - // Prefer `-sdk` paths. - if (!searchPathOpts.getSDKPath().empty()) { + // Prefer `-sdk` paths for Darwin. + if (triple.isOSDarwin() && !searchPathOpts.getSDKPath().empty()) { llvm::SmallString<261> path{searchPathOpts.getSDKPath()}; llvm::sys::path::append(path, "usr", "lib", "swift", "apinotes"); diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 130b614943174..c3e6a3e6820d0 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -2282,6 +2282,7 @@ static bool validateSwiftModuleFileArgumentAndAdd(const std::string &swiftModule static bool ParseSearchPathArgs(SearchPathOptions &Opts, ArgList &Args, DiagnosticEngine &Diags, + const llvm::Triple &Triple, const CASOptions &CASOpts, const FrontendOptions &FrontendOpts, StringRef workingDirectory) { @@ -2416,6 +2417,18 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts, ArgList &Args, if (const Arg *A = Args.getLastArg(OPT_resource_dir)) Opts.RuntimeResourcePath = A->getValue(); + else if (!Triple.isOSDarwin() && Args.hasArg(OPT_sdk)) { + llvm::SmallString<128> SDKResourcePath(Opts.getSDKPath()); + llvm::sys::path::append( + SDKResourcePath, "usr", "lib", + FrontendOpts.UseSharedResourceFolder ? "swift" : "swift_static"); + // Check for eg /usr/lib/swift/ + if (llvm::sys::fs::exists(SDKResourcePath)) + Opts.RuntimeResourcePath = SDKResourcePath.str(); + else + Diags.diagnose(SourceLoc(), diag::warning_no_resource_dir_in_sdk, + Opts.RuntimeResourcePath); + } Opts.SkipAllImplicitImportPaths |= Args.hasArg(OPT_nostdimport); Opts.SkipSDKImportPaths |= Args.hasArg(OPT_nostdlibimport); @@ -4075,7 +4088,7 @@ bool CompilerInvocation::parseArgs( ParseSymbolGraphArgs(SymbolGraphOpts, ParsedArgs, Diags, LangOpts); - if (ParseSearchPathArgs(SearchPathOpts, ParsedArgs, Diags, + if (ParseSearchPathArgs(SearchPathOpts, ParsedArgs, Diags, LangOpts.Target, CASOpts, FrontendOpts, workingDirectory)) { return true; } diff --git a/test/Inputs/clang-importer-sdk/usr/lib/swift/apinotes/cfuncs.apinotes b/test/ClangImporter/Inputs/cfuncs.apinotes similarity index 100% rename from test/Inputs/clang-importer-sdk/usr/lib/swift/apinotes/cfuncs.apinotes rename to test/ClangImporter/Inputs/cfuncs.apinotes diff --git a/test/ClangImporter/sdk-apinotes.swift b/test/ClangImporter/sdk-apinotes.swift index 8e53a0564569b..5c47d7781946c 100644 --- a/test/ClangImporter/sdk-apinotes.swift +++ b/test/ClangImporter/sdk-apinotes.swift @@ -1,4 +1,10 @@ -// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -verify +// RUN: %empty-directory(%t/sdk/usr/lib/swift/apinotes) +// RUN: %empty-directory(%t/sdk/usr/lib/swift/%target-sdk-name) +// RUN: cp -r %clang-importer-sdk-path/usr/include %t/sdk/usr +// RUN: cp -r %test-resource-dir/shims %t/sdk/usr/lib/swift +// RUN: cp %S/Inputs/cfuncs.apinotes %t/sdk/usr/lib/swift/apinotes +// RUN: cp -r %platform-module-dir/Swift.swiftmodule %t/sdk/usr/lib/swift/%target-sdk-name/ +// RUN: %target-swift-frontend(mock-sdk: -sdk %t/sdk) -typecheck %s -verify -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import import cfuncs diff --git a/test/ModuleInterface/swift_build_sdk_interfaces/check-only-mode.swift b/test/ModuleInterface/swift_build_sdk_interfaces/check-only-mode.swift index 3e499cae7a30e..6eef7cbd39181 100644 --- a/test/ModuleInterface/swift_build_sdk_interfaces/check-only-mode.swift +++ b/test/ModuleInterface/swift_build_sdk_interfaces/check-only-mode.swift @@ -1,8 +1,11 @@ // RUN: %empty-directory(%t) -// RUN: mkdir -p %t/sdk/usr/lib/swift/Normal.swiftmodule +// RUN: mkdir -p %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule // RUN: mkdir -p %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule +// RUN: %empty-directory(%t/sdk/usr/lib/swift/%target-sdk-name) +// RUN: cp -r %platform-module-dir/{_Concurrency,_StringProcessing,Swift,SwiftOnoneSupport}.swiftmodule %t/sdk/usr/lib/swift/%target-sdk-name/ +// RUN: cp -r %test-resource-dir/shims %t/sdk/usr/lib/swift -// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name Normal +// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name Normal // RUN: echo 'public func flat() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Flat.swiftinterface -emit-module -o /dev/null -module-name Flat // RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name FMWK @@ -12,14 +15,14 @@ // CHECK-DAG: Flat.swiftmodule // CHECK-DAG: FMWK.swiftmodule -// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt -// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule +// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -I %t/sdk/System/iOSSupport/usr/lib/swift -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt +// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/{Normal,Flat,FMWK}-*.swiftmodule // Touch a file in the SDK (to make it look like it changed) and try again. // In -check-only mode, this should force a rebuild. // RUN: rm -rf %t/MCP -// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt +// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name +// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -I %t/sdk/System/iOSSupport/usr/lib/swift -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt // RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule import Normal diff --git a/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt-envvar.swift b/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt-envvar.swift index 09844aed510ac..91080af58d209 100644 --- a/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt-envvar.swift +++ b/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt-envvar.swift @@ -1,8 +1,11 @@ // RUN: %empty-directory(%t) -// RUN: mkdir -p %t/sdk/usr/lib/swift/Normal.swiftmodule +// RUN: mkdir -p %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule // RUN: mkdir -p %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule +// RUN: %empty-directory(%t/sdk/usr/lib/swift/%target-sdk-name) +// RUN: cp -r %platform-module-dir/{_Concurrency,_StringProcessing,Swift,SwiftOnoneSupport}.swiftmodule %t/sdk/usr/lib/swift/%target-sdk-name/ +// RUN: cp -r %test-resource-dir/shims %t/sdk/usr/lib/swift -// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name Normal +// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name Normal // RUN: echo 'public func flat() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Flat.swiftinterface -emit-module -o /dev/null -module-name Flat // RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name FMWK @@ -12,17 +15,17 @@ // CHECK-DAG: Flat.swiftmodule // CHECK-DAG: FMWK.swiftmodule -// RUN: env SWIFT_OVERLOAD_PREBUILT_MODULE_CACHE_PATH=%t/prebuilt %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule +// RUN: env SWIFT_OVERLOAD_PREBUILT_MODULE_CACHE_PATH=%t/prebuilt %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -I %t/sdk/System/iOSSupport/usr/lib/swift/ -module-cache-path %t/MCP +// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/{FMWK,Flat,Normal}-*.swiftmodule // Touch a file in the SDK (to make it look like it changed) and try again. // This should still be able to use the prebuilt modules because they track // content hashes, not just size+mtime. // RUN: rm -rf %t/MCP -// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -// RUN: env SWIFT_OVERLOAD_PREBUILT_MODULE_CACHE_PATH=%t/prebuilt %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP +// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name +// RUN: env SWIFT_OVERLOAD_PREBUILT_MODULE_CACHE_PATH=%t/prebuilt %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -I %t/sdk/System/iOSSupport/usr/lib/swift/ -module-cache-path %t/MCP // RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s -// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule +// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/{FMWK,Flat,Normal}-*.swiftmodule // CHECK-CACHE-DAG: Normal-{{.+}}.swiftmodule // CHECK-CACHE-DAG: Flat-{{.+}}.swiftmodule @@ -31,8 +34,8 @@ // Actually change a file in the SDK, to check that we're tracking dependencies // at all. // RUN: rm -rf %t/MCP -// RUN: echo "public func another()" >> %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -// RUN: env SWIFT_OVERLOAD_PREBUILT_MODULE_CACHE_PATH=%t/prebuilt %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP +// RUN: echo "public func another()" >> %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name +// RUN: env SWIFT_OVERLOAD_PREBUILT_MODULE_CACHE_PATH=%t/prebuilt %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -I %t/sdk/System/iOSSupport/usr/lib/swift/ -module-cache-path %t/MCP // RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s // RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule // RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Flat-*.swiftmodule @@ -41,7 +44,7 @@ // Without the prebuilt cache everything should still work; it'll just take time // because we have to build the interfaces. // RUN: rm -rf %t/MCP -// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP +// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -I %t/sdk/System/iOSSupport/usr/lib/swift/ -module-cache-path %t/MCP // RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s // RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule // RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Flat-*.swiftmodule diff --git a/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt.swift b/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt.swift index 352734a2a5dcd..a6aa53a650c18 100644 --- a/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt.swift +++ b/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt.swift @@ -1,8 +1,11 @@ // RUN: %empty-directory(%t) -// RUN: mkdir -p %t/sdk/usr/lib/swift/Normal.swiftmodule +// RUN: mkdir -p %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule // RUN: mkdir -p %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule +// RUN: %empty-directory(%t/sdk/usr/lib/swift/%target-sdk-name) +// RUN: cp -r %platform-module-dir/{_Concurrency,_StringProcessing,Swift,SwiftOnoneSupport}.swiftmodule %t/sdk/usr/lib/swift/%target-sdk-name/ +// RUN: cp -r %test-resource-dir/shims %t/sdk/usr/lib/swift -// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name Normal +// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name Normal // RUN: echo 'public func flat() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Flat.swiftinterface -emit-module -o /dev/null -module-name Flat // RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name FMWK @@ -12,17 +15,17 @@ // CHECK-DAG: Flat.swiftmodule // CHECK-DAG: FMWK.swiftmodule -// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt -// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule +// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -I %t/sdk/System/iOSSupport/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt +// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/{FMWK,Flat,Normal}-*.swiftmodule // Touch a file in the SDK (to make it look like it changed) and try again. // This should still be able to use the prebuilt modules because they track // content hashes, not just size+mtime. // RUN: rm -rf %t/MCP -// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt +// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name +// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -I %t/sdk/System/iOSSupport/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt // RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s -// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule +// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/{FMWK,Flat,Normal}-*.swiftmodule // CHECK-CACHE-DAG: Normal-{{.+}}.swiftmodule // CHECK-CACHE-DAG: Flat-{{.+}}.swiftmodule @@ -31,8 +34,8 @@ // Actually change a file in the SDK, to check that we're tracking dependencies // at all. // RUN: rm -rf %t/MCP -// RUN: echo "public func another()" >> %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt +// RUN: echo "public func another()" >> %t/sdk/System/iOSSupport/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name +// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -I %t/sdk/System/iOSSupport/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt // RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s // RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule // RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Flat-*.swiftmodule @@ -41,7 +44,7 @@ // Without the prebuilt cache everything should still work; it'll just take time // because we have to build the interfaces. // RUN: rm -rf %t/MCP -// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP +// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -I %t/sdk/System/iOSSupport/usr/lib/swift/ -module-cache-path %t/MCP // RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s // RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule // RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Flat-*.swiftmodule diff --git a/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift b/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift index 55f0c2b4b96ed..524c4dc875dd1 100644 --- a/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift +++ b/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift @@ -1,5 +1,8 @@ // RUN: %empty-directory(%t) // RUN: cp -r %S/Inputs/system-dependencies-sdk %t/sdk +// RUN: %empty-directory(%t/sdk/usr/lib/swift/%target-sdk-name) +// RUN: cp -r %platform-module-dir/{_Concurrency,_StringProcessing,Swift,SwiftOnoneSupport}.swiftmodule %t/sdk/usr/lib/swift/%target-sdk-name/ +// RUN: cp -r %test-resource-dir/shims %t/sdk/usr/lib/swift // RUN: echo 'import Platform; public func usesCStruct(_: SomeCStruct?) {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Swifty.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name Swifty -sdk %t/sdk // RUN: %swift_build_sdk_interfaces -sdk %t/sdk -v -o %t/prebuilt @@ -7,7 +10,7 @@ // CHECK: Swifty.swiftmodule // RUN: %target-typecheck-verify-swift -sdk %t/sdk -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt -// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule +// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Swifty-*.swiftmodule // Touch a file in the SDK (to make it look like it changed) and try again. // This should still be able to use the prebuilt modules because they track diff --git a/test/ModuleInterface/swift_build_sdk_interfaces/xfails.test-sh b/test/ModuleInterface/swift_build_sdk_interfaces/xfails.test-sh index 98f8458bab8f8..6866b9453e732 100644 --- a/test/ModuleInterface/swift_build_sdk_interfaces/xfails.test-sh +++ b/test/ModuleInterface/swift_build_sdk_interfaces/xfails.test-sh @@ -1,7 +1,11 @@ RUN: %empty-directory(%t) -RUN: env SWIFT_EXEC=%swiftc_driver_plain not %{python} %utils/swift_build_sdk_interfaces.py %mcp_opt -sdk %S/Inputs/xfails-sdk/ -o %t/output -log-path %t | %FileCheck %s +RUN: cp -r %S/Inputs/xfails-sdk %t/sdk +RUN: %empty-directory(%t/sdk/usr/lib/swift/%target-sdk-name) +RUN: cp -r %platform-module-dir/{_Concurrency,_StringProcessing,Swift,SwiftOnoneSupport}.swiftmodule %t/sdk/usr/lib/swift/%target-sdk-name/ +RUN: cp -r %test-resource-dir/shims %t/sdk/usr/lib/swift +RUN: env SWIFT_EXEC=%swiftc_driver_plain not %{python} %utils/swift_build_sdk_interfaces.py %mcp_opt -sdk %t/sdk/ -o %t/output -log-path %t | %FileCheck %s RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/Bad-Bad-err.txt -RUN: env SWIFT_EXEC=%swiftc_driver_plain not %{python} %utils/swift_build_sdk_interfaces.py %mcp_opt -sdk %S/Inputs/xfails-sdk/ -v -o %t/output -log-path %t | %FileCheck -check-prefix CHECK-VERBOSE %s +RUN: env SWIFT_EXEC=%swiftc_driver_plain not %{python} %utils/swift_build_sdk_interfaces.py %mcp_opt -sdk %t/sdk/ -v -o %t/output -log-path %t | %FileCheck -check-prefix CHECK-VERBOSE %s RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/Bad-Bad-err.txt CHECK: # (FAIL) {{.+}}{{\\|/}}Bad.swiftinterface @@ -11,31 +15,31 @@ CHECK-VERBOSE-DAG: # (PASS) {{.+}}{{\\|/}}Good.swiftinterface PRINTS-ERROR: cannot find 'garbage' in scope HIDES-ERROR-NOT: cannot find 'garbage' in scope -RUN: %empty-directory(%t) +RUN: %empty-directory(%t/output) RUN: echo '["Good"]' > %t/xfails-good.json -RUN: env SWIFT_EXEC=%swiftc_driver_plain not %{python} %utils/swift_build_sdk_interfaces.py %mcp_opt -sdk %S/Inputs/xfails-sdk/ -o %t/output -xfails %t/xfails-good.json -log-path %t | %FileCheck -check-prefix=CHECK-XFAIL-GOOD %s +RUN: env SWIFT_EXEC=%swiftc_driver_plain not %{python} %utils/swift_build_sdk_interfaces.py %mcp_opt -sdk %t/sdk/ -o %t/output -xfails %t/xfails-good.json -log-path %t | %FileCheck -check-prefix=CHECK-XFAIL-GOOD %s RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/Bad-Bad-err.txt -RUN: env SWIFT_EXEC=%swiftc_driver_plain not %{python} %utils/swift_build_sdk_interfaces.py %mcp_opt -sdk %S/Inputs/xfails-sdk/ -v -o %t/output -xfails %t/xfails-good.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-GOOD %s +RUN: env SWIFT_EXEC=%swiftc_driver_plain not %{python} %utils/swift_build_sdk_interfaces.py %mcp_opt -sdk %t/sdk/ -v -o %t/output -xfails %t/xfails-good.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-GOOD %s RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/Bad-Bad-err.txt CHECK-XFAIL-GOOD-DAG: # (FAIL) {{.+}}{{\\|/}}Bad.swiftinterface CHECK-XFAIL-GOOD-DAG: # (UPASS) {{.+}}{{\\|/}}Good.swiftinterface -RUN: %empty-directory(%t) +RUN: %empty-directory(%t/output) RUN: echo '["Good", "Bad"]' > %t/xfails-good-and-bad.json -RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -o %t/output -xfails %t/xfails-good-and-bad.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-GOOD-AND-BAD %s +RUN: %swift_build_sdk_interfaces -sdk %t/sdk/ -o %t/output -xfails %t/xfails-good-and-bad.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-GOOD-AND-BAD %s RUN: %FileCheck -check-prefix HIDES-ERROR -allow-empty %s < %t/stderr.txt -RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -v -o %t/output -xfails %t/xfails-good-and-bad.json -log-path %t | %FileCheck -check-prefix=CHECK-XFAIL-GOOD-AND-BAD %s +RUN: %swift_build_sdk_interfaces -sdk %t/sdk/ -v -o %t/output -xfails %t/xfails-good-and-bad.json -log-path %t | %FileCheck -check-prefix=CHECK-XFAIL-GOOD-AND-BAD %s RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/Bad-Bad-err.txt CHECK-XFAIL-GOOD-AND-BAD-DAG: # (XFAIL) {{.+}}{{\\|/}}Bad.swiftinterface CHECK-XFAIL-GOOD-AND-BAD-DAG: # (UPASS) {{.+}}{{\\|/}}Good.swiftinterface -RUN: %empty-directory(%t) +RUN: %empty-directory(%t/output) RUN: echo '["Bad"]' > %t/xfails-bad.json -RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -o %t/output -xfails %t/xfails-bad.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-BAD %s +RUN: %swift_build_sdk_interfaces -sdk %t/sdk/ -o %t/output -xfails %t/xfails-bad.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-BAD %s RUN: %FileCheck -check-prefix HIDES-ERROR -allow-empty %s < %t/stderr.txt -RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -v -o %t/output -xfails %t/xfails-bad.json -log-path %t | %FileCheck -check-prefix=CHECK-XFAIL-BAD-VERBOSE %s +RUN: %swift_build_sdk_interfaces -sdk %t/sdk/ -v -o %t/output -xfails %t/xfails-bad.json -log-path %t | %FileCheck -check-prefix=CHECK-XFAIL-BAD-VERBOSE %s RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/Bad-Bad-err.txt CHECK-XFAIL-BAD: # (XFAIL) {{.+}}{{\\|/}}Bad.swiftinterface diff --git a/test/Serialization/module_defining_interface.swift b/test/Serialization/module_defining_interface.swift index fee71bb39c61f..69aaa009857fd 100644 --- a/test/Serialization/module_defining_interface.swift +++ b/test/Serialization/module_defining_interface.swift @@ -1,8 +1,9 @@ // RUN: %empty-directory(%t) // RUN: %empty-directory(%t/inputs) // RUN: %empty-directory(%t/test-sdk) -// RUN: %empty-directory(%t/test-sdk/usr/lib/swift) -// RUN: cp -r %platform-module-dir/Swift.swiftmodule %t/test-sdk/usr/lib/swift/Swift.swiftmodule +// RUN: %empty-directory(%t/test-sdk/usr/lib/swift/%target-sdk-name) +// RUN: cp -r %test-resource-dir/shims %t/test-sdk/usr/lib/swift +// RUN: cp -r %platform-module-dir/Swift{,OnoneSupport}.swiftmodule %t/test-sdk/usr/lib/swift/%target-sdk-name/ // RUN: %empty-directory(%t/test-sdk/usr/lib/Foo.swiftmodule) // RUN: split-file %s %t diff --git a/test/Serialization/module_defining_interface_client.swift b/test/Serialization/module_defining_interface_client.swift index 6f075677be096..aa5abda30b377 100644 --- a/test/Serialization/module_defining_interface_client.swift +++ b/test/Serialization/module_defining_interface_client.swift @@ -1,12 +1,13 @@ // RUN: %empty-directory(%t) // RUN: %empty-directory(%t/inputs) // RUN: %empty-directory(%t/test-sdk) -// RUN: %empty-directory(%t/test-sdk/usr/lib/swift) +// RUN: %empty-directory(%t/test-sdk/usr/lib/swift/%target-sdk-name) // RUN: %empty-directory(%t/test-sdk/usr/lib/Foo.swiftmodule) // RUN: %empty-directory(%t/test-sdk/usr/lib/Bar.swiftmodule) // RUN: %empty-directory(%t/test-sdk/usr/lib/_Foo_Bar.swiftmodule) // RUN: %empty-directory(%t/test-sdk/usr/lib/Foo.swiftcrossimport) -// RUN: cp -r %platform-module-dir/Swift.swiftmodule %t/test-sdk/usr/lib/swift/Swift.swiftmodule +// RUN: cp -r %test-resource-dir/shims %t/test-sdk/usr/lib/swift +// RUN: cp -r %platform-module-dir/Swift{,OnoneSupport}.swiftmodule %t/test-sdk/usr/lib/swift/%target-sdk-name/ // RUN: split-file %s %t diff --git a/test/embedded/builtin-float.swift b/test/embedded/builtin-float.swift index 0e1cbc5526f00..0aad98a3bd6db 100644 --- a/test/embedded/builtin-float.swift +++ b/test/embedded/builtin-float.swift @@ -2,7 +2,7 @@ // RUN: mkdir -p %t/include // RUN: %{python} %utils/split_file.py -o %t %s -// RUN: %target-swift-frontend -target armv7em-none-none-eabi -emit-ir %t/Main.swift -enable-experimental-feature Embedded -module-cache-path %t/ModuleCache -Xcc -I%t/include +// RUN: %swift_frontend_plain -target armv7em-none-none-eabi -emit-ir %t/Main.swift -enable-experimental-feature Embedded -module-cache-path %t/ModuleCache -Xcc -I%t/include // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler diff --git a/test/embedded/float-abi-hard.swift b/test/embedded/float-abi-hard.swift index f410efd604984..f309506e0e59a 100644 --- a/test/embedded/float-abi-hard.swift +++ b/test/embedded/float-abi-hard.swift @@ -1,7 +1,7 @@ // RUN: %empty-directory(%t) // RUN: %{python} %utils/split_file.py -o %t %s -// RUN: %target-swift-emit-ir %t/Main.swift -import-bridging-header %t/BridgingHeader.h -parse-as-library -enable-experimental-feature Embedded -wmo \ +// RUN: %swift_frontend_plain -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: CPU=wasm32 diff --git a/test/embedded/fragile-reference.swift b/test/embedded/fragile-reference.swift index 07b21a9272a10..a6ed7f00822a0 100644 --- a/test/embedded/fragile-reference.swift +++ b/test/embedded/fragile-reference.swift @@ -1,5 +1,5 @@ -// 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: %swift_frontend_plain -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler diff --git a/test/embedded/no-allocations-print.swift b/test/embedded/no-allocations-print.swift index ae3270463bd12..51f68b525c5d2 100644 --- a/test/embedded/no-allocations-print.swift +++ b/test/embedded/no-allocations-print.swift @@ -1,7 +1,7 @@ // 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: %swift_frontend_plain -emit-ir -target armv7-apple-none-macho -no-allocations %s -enable-experimental-feature Embedded +// RUN: %swift_frontend_plain -emit-ir -target arm64-apple-none-macho -no-allocations %s -enable-experimental-feature Embedded // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler diff --git a/test/embedded/optionset2.swift b/test/embedded/optionset2.swift index babe9b6fe15a4..72f4534ece1ab 100644 --- a/test/embedded/optionset2.swift +++ b/test/embedded/optionset2.swift @@ -1,5 +1,5 @@ -// 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: %swift_frontend_plain -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler @@ -8,9 +8,6 @@ // REQUIRES: embedded_stdlib_cross_compiling // REQUIRES: swift_feature_Embedded -// https://github.com/apple/swift/issues/73249 -// UNSUPPORTED: OS=windows-msvc - protocol MyOptionSet: Equatable { init(rawValue: Int) init() diff --git a/test/embedded/ouroboros-bug.swift b/test/embedded/ouroboros-bug.swift index 7bceb38af6a76..b6801ec9aae0f 100644 --- a/test/embedded/ouroboros-bug.swift +++ b/test/embedded/ouroboros-bug.swift @@ -3,8 +3,8 @@ // 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: %swift_frontend_plain -target armv7-apple-none-macho -assert-config Debug -Osize -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64-apple-none-macho -assert-config Debug -Osize -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler @@ -13,9 +13,6 @@ // REQUIRES: embedded_stdlib_cross_compiling // REQUIRES: swift_feature_Embedded -// https://github.com/apple/swift/issues/73249 -// UNSUPPORTED: OS=windows-msvc - public func test() {} test() diff --git a/test/embedded/ptrauth-none-macho.swift b/test/embedded/ptrauth-none-macho.swift index 057a542d3f800..38a7da4813915 100644 --- a/test/embedded/ptrauth-none-macho.swift +++ b/test/embedded/ptrauth-none-macho.swift @@ -1,5 +1,5 @@ -// RUN: %target-swift-frontend -target arm64e-apple-none-macho -enable-experimental-feature Embedded -emit-ir %s -o - | %FileCheck %s -// RUN: %target-swift-frontend -target arm64e-apple-macos14 -enable-experimental-feature Embedded -emit-ir %s -o - | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64e-apple-none-macho -enable-experimental-feature Embedded -emit-ir %s -o - | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64e-apple-macos14 -enable-experimental-feature Embedded -emit-ir %s -o - | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: OS=macosx diff --git a/test/embedded/static-object-non-darwin.swift b/test/embedded/static-object-non-darwin.swift index 93d14a5aa05b9..6ef10cf278b0c 100644 --- a/test/embedded/static-object-non-darwin.swift +++ b/test/embedded/static-object-non-darwin.swift @@ -1,5 +1,5 @@ -// RUN: %target-swift-frontend -target armv7em-none-none-eabi -parse-as-library -module-name main -O -emit-ir %s -enable-experimental-feature Embedded -Xllvm -link-embedded-runtime=0 | %FileCheck %s -// RUN: %target-swift-frontend -target armv7em-none-none-eabi -parse-as-library -module-name main -Osize -emit-ir %s -enable-experimental-feature Embedded -Xllvm -link-embedded-runtime=0 | %FileCheck %s +// RUN: %swift_frontend_plain -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: %swift_frontend_plain -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: CPU=wasm32 // REQUIRES: swift_in_compiler diff --git a/test/embedded/stdlib-array.swift b/test/embedded/stdlib-array.swift index 476c736092832..8eb2d44589aa1 100644 --- a/test/embedded/stdlib-array.swift +++ b/test/embedded/stdlib-array.swift @@ -1,5 +1,5 @@ -// 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: %swift_frontend_plain -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler @@ -8,9 +8,6 @@ // REQUIRES: embedded_stdlib_cross_compiling // REQUIRES: swift_feature_Embedded -// https://github.com/apple/swift/issues/73249 -// UNSUPPORTED: OS=windows-msvc - public func test() { var array: [Int] = [1, 2, 3] array.append(42) diff --git a/test/embedded/stdlib-basic.swift b/test/embedded/stdlib-basic.swift index 3e0c61420490f..9f9d4a2cf592b 100644 --- a/test/embedded/stdlib-basic.swift +++ b/test/embedded/stdlib-basic.swift @@ -1,5 +1,5 @@ -// 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: %swift_frontend_plain -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler @@ -7,9 +7,6 @@ // REQUIRES: embedded_stdlib_cross_compiling // REQUIRES: swift_feature_Embedded -// https://github.com/apple/swift/issues/73249 -// UNSUPPORTED: OS=windows-msvc - public func bool() -> Bool { return true } diff --git a/test/embedded/stdlib-dictionary.swift b/test/embedded/stdlib-dictionary.swift index ac4dbfbc67214..cccfd232afcf6 100644 --- a/test/embedded/stdlib-dictionary.swift +++ b/test/embedded/stdlib-dictionary.swift @@ -1,5 +1,5 @@ -// 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: %swift_frontend_plain -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler @@ -7,9 +7,6 @@ // REQUIRES: embedded_stdlib_cross_compiling // REQUIRES: swift_feature_Embedded -// https://github.com/apple/swift/issues/73249 -// UNSUPPORTED: OS=windows-msvc - public func test() { var d: [Int:Int] = [1: 2, 3: 4, 5: 6] d[8] = 9 diff --git a/test/embedded/stdlib-random.swift b/test/embedded/stdlib-random.swift index 4e3eaa4d8a6c9..aabf90e481e2a 100644 --- a/test/embedded/stdlib-random.swift +++ b/test/embedded/stdlib-random.swift @@ -1,5 +1,5 @@ -// 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: %swift_frontend_plain -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler @@ -7,9 +7,6 @@ // REQUIRES: embedded_stdlib_cross_compiling // REQUIRES: swift_feature_Embedded -// https://github.com/apple/swift/issues/73249 -// UNSUPPORTED: OS=windows-msvc - public func test() { Bool.random() Int.random(in: 0 ..< 100) diff --git a/test/embedded/stdlib-set.swift b/test/embedded/stdlib-set.swift index bf7e0cad3a204..51b29f96f191e 100644 --- a/test/embedded/stdlib-set.swift +++ b/test/embedded/stdlib-set.swift @@ -1,5 +1,5 @@ -// 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: %swift_frontend_plain -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler @@ -8,9 +8,6 @@ // REQUIRES: embedded_stdlib_cross_compiling // REQUIRES: swift_feature_Embedded -// https://github.com/apple/swift/issues/73249 -// UNSUPPORTED: OS=windows-msvc - public func test() { var s: Set = [1, 2, 3] s.insert(42) diff --git a/test/embedded/stdlib-strings-interpolation3.swift b/test/embedded/stdlib-strings-interpolation3.swift index f98ffc34ed36b..d386350472aa2 100644 --- a/test/embedded/stdlib-strings-interpolation3.swift +++ b/test/embedded/stdlib-strings-interpolation3.swift @@ -1,6 +1,6 @@ -// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -O -// RUN: %target-swift-frontend -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -Osize +// RUN: %swift_frontend_plain -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded +// RUN: %swift_frontend_plain -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -O +// RUN: %swift_frontend_plain -target armv7-apple-none-macho -module-name main -parse-as-library -emit-ir %s -enable-experimental-feature Embedded -Osize // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler diff --git a/test/embedded/stdlib-types-riscv.swift b/test/embedded/stdlib-types-riscv.swift index 820bbfe269616..1a347bff735ff 100644 --- a/test/embedded/stdlib-types-riscv.swift +++ b/test/embedded/stdlib-types-riscv.swift @@ -1,5 +1,5 @@ -// 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 +// RUN: %swift_frontend_plain -target riscv32-none-none-eabi -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %swift_frontend_plain -target riscv64-none-none-eabi -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler diff --git a/test/embedded/stdlib-types.swift b/test/embedded/stdlib-types.swift index c3f57104122b9..75c2187dd60ed 100644 --- a/test/embedded/stdlib-types.swift +++ b/test/embedded/stdlib-types.swift @@ -1,5 +1,5 @@ -// 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: %swift_frontend_plain -target armv7-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s +// RUN: %swift_frontend_plain -target arm64-apple-none-macho -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s // UNSUPPORTED: CPU=wasm32 // REQUIRES: swift_in_compiler @@ -8,9 +8,6 @@ // REQUIRES: embedded_stdlib_cross_compiling // REQUIRES: swift_feature_Embedded -// https://github.com/apple/swift/issues/73249 -// UNSUPPORTED: OS=windows-msvc - class MyClass {} public func test() { diff --git a/utils/build.ps1 b/utils/build.ps1 index dfe3a6dda7ff2..6263fab7cfeb2 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -1510,7 +1510,7 @@ function Build-CMakeProject { # Disable EnC as that introduces padding in the conformance tables $SwiftFlags += @("-Xlinker", "/INCREMENTAL:NO") # Swift requires COMDAT folding and de-duplication - $SwiftFlags += @("-Xlinker", "/OPT:REF", "-Xlinker", "/OPT:ICF") + $SwiftFlags += @("-Xlinker", "/OPT:REF", "-Xlinker", "/OPT:ICF", "-v", "-Xcc", "-v") Add-FlagsDefine $Defines CMAKE_Swift_FLAGS $SwiftFlags # Workaround CMake 3.26+ enabling `-wmo` by default on release builds @@ -2774,7 +2774,7 @@ function Build-Foundation { $SwiftSDK = if ($Static) { Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental" - } else { + } elseif ($Platform.OS -ne [OS]::Windows) { Get-SwiftSDK $Platform.OS }