From c749a6665ba2252f88fcff586694bdbf9c8d0bb0 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 10 Dec 2025 11:48:17 -0800 Subject: [PATCH 1/7] test: introduce `swift-target-frontend-plain` for CAS tests This introduces a new substitution for use in the CAS tests. The plain variant of the target frontend invokes the tool with the variant target triple and resource dir only. This allows us to properly invoke the frontend for the CAS tests. --- test/CAS/Xcc_args.swift | 2 +- test/CAS/Xcc_objc_direct.swift | 2 +- test/CAS/block-list.swift | 2 +- test/CAS/bridging-header-prefix-map.swift | 8 +++---- test/CAS/cache_key_compute.swift | 24 ++++++++++----------- test/CAS/cache_replay.swift | 10 ++++----- test/CAS/cache_replay_multiple_files.swift | 12 +++++------ test/CAS/cached_diagnostics.swift | 18 +++++++++------- test/CAS/cached_diagnostics_macro.swift | 2 +- test/CAS/cached_diagnostics_pcm.swift | 2 +- test/CAS/cached_diagnostics_remap.swift | 14 ++++++------ test/CAS/can-import.swift | 2 +- test/CAS/cas-explicit-module-map.swift | 10 ++++----- test/CAS/cas_output_backend.swift | 4 ++-- test/CAS/cross_import.swift | 2 +- test/CAS/debuginfo_invariant.swift | 2 +- test/CAS/dependency_file.swift | 10 ++++----- test/CAS/embedded-Xcc.swift | 2 +- test/CAS/include-tree.swift | 4 ++-- test/CAS/index-store.swift | 4 ++-- test/CAS/loc-directive-diagnostics.swift | 6 +++--- test/CAS/macro_deps.swift | 4 ++-- test/CAS/macro_option_set.swift | 2 +- test/CAS/macro_plugin.swift | 4 ++-- test/CAS/macro_plugin_external.swift | 14 ++++++------ test/CAS/module_dep_path.swift | 4 ++-- test/CAS/module_trace.swift | 4 ++-- test/CAS/no-cas-path-dependency.swift | 4 ++-- test/CAS/opt-record.swift | 4 ++-- test/CAS/reproducer.swift | 9 ++++---- test/CAS/swift-scan-diagnostics-batch.swift | 16 ++++++++------ test/CAS/swift-scan-diagnostics.swift | 16 ++++++++------ test/CAS/swift-scan-response-file.swift | 6 +++--- test/CAS/swift-scan-test-llvm-args.swift | 10 +++++---- test/CAS/swift-scan-test.swift | 13 ++++++----- test/CAS/symbol-graph.swift | 13 ++++++----- test/CAS/uncached-casfs.swift | 6 +++--- test/CAS/vfsoverlay.swift | 2 +- test/lit.cfg | 8 +++++++ 39 files changed, 154 insertions(+), 127 deletions(-) diff --git a/test/CAS/Xcc_args.swift b/test/CAS/Xcc_args.swift index c65dfadf37b56..80ef724d599d5 100644 --- a/test/CAS/Xcc_args.swift +++ b/test/CAS/Xcc_args.swift @@ -19,7 +19,7 @@ // CHECK-NOT: -ivfsoverlay // CHECK-NOT: -fmodule-map-file -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -module-name Test \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ diff --git a/test/CAS/Xcc_objc_direct.swift b/test/CAS/Xcc_objc_direct.swift index f07f71b24085c..10c17fb16f494 100644 --- a/test/CAS/Xcc_objc_direct.swift +++ b/test/CAS/Xcc_objc_direct.swift @@ -9,7 +9,7 @@ // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/MyApp.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -module-name Test \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ diff --git a/test/CAS/block-list.swift b/test/CAS/block-list.swift index be4a3cb4ebc4b..2c67c919bea3d 100644 --- a/test/CAS/block-list.swift +++ b/test/CAS/block-list.swift @@ -22,7 +22,7 @@ // FS-DAG: blocklist.yml // FS-DAG: empty.yml -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -target %target-future-triple \ // RUN: -emit-ir -o - -cache-compile-job -cas-path %t/cas -O \ // RUN: -swift-version 5 -module-name Test \ diff --git a/test/CAS/bridging-header-prefix-map.swift b/test/CAS/bridging-header-prefix-map.swift index 212cdbbcd3ce1..dff14e5a426f1 100644 --- a/test/CAS/bridging-header-prefix-map.swift +++ b/test/CAS/bridging-header-prefix-map.swift @@ -27,9 +27,9 @@ // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps-1.json -o %t/MyApp.cmd -b %t/header.cmd -// RUN: %target-swift-frontend @%t/header.cmd /^header/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch +// RUN: %target-swift-frontend-plain @%t/header.cmd /^header/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend @%t/header.cmd /^header/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch > %t/keys.json +// RUN: %target-swift-frontend-plain @%t/header.cmd /^header/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch > %t/keys.json // RUN: %{python} %S/Inputs/ExtractOutputKey.py %t/keys.json > %t/key // RUN: echo "\"-disable-implicit-string-processing-module-import\"" >> %t/MyApp.cmd @@ -40,10 +40,10 @@ // RUN: echo "\"%t/bridging.pch\"" >> %t/MyApp.cmd // RUN: echo "\"-bridging-header-pch-key\"" >> %t/MyApp.cmd // RUN: echo "\"@%t/key\"" >> %t/MyApp.cmd -// RUN: %target-swift-frontend -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd /^tmp/test.swift \ +// RUN: %target-swift-frontend-plain -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd /^tmp/test.swift \ // RUN: -emit-module -o %t/Test.swiftmodule -// RUN: %target-swift-frontend -scan-dependencies -module-name User -module-cache-path %t/clang-module-cache -O \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-name User -module-cache-path %t/clang-module-cache -O \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: %t/user.swift -o %t/deps-3.json -auto-bridging-header-chaining -cache-compile-job -cas-path %t/cas \ // RUN: -scanner-prefix-map-paths %swift_src_root /^src -scanner-prefix-map-paths %t /^tmp \ diff --git a/test/CAS/cache_key_compute.swift b/test/CAS/cache_key_compute.swift index 62c3423e37f69..d8ff682a849f9 100644 --- a/test/CAS/cache_key_compute.swift +++ b/test/CAS/cache_key_compute.swift @@ -22,16 +22,16 @@ /// Check few working cases. // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \ -// RUN: %target-swift-frontend -cache-compile-job %t/a.swift -c @%t/MyApp.cmd > %t1.casid +// RUN: %target-swift-frontend-plain -cache-compile-job %t/a.swift -c @%t/MyApp.cmd > %t1.casid /// A different CAS doesn't affect base key. // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \ -// RUN: %target-swift-frontend -cache-compile-job %t/a.swift -c @%t/MyApp.cmd -cas-path %t > %t2.casid +// RUN: %target-swift-frontend-plain -cache-compile-job %t/a.swift -c @%t/MyApp.cmd -cas-path %t > %t2.casid /// Output path doesn't affect base key. // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \ -// RUN: %target-swift-frontend -cache-compile-job %t/a.swift -c @%t/MyApp.cmd -o %t/test.o > %t3.casid +// RUN: %target-swift-frontend-plain -cache-compile-job %t/a.swift -c @%t/MyApp.cmd -o %t/test.o > %t3.casid /// Add -D will change. // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \ -// RUN: %target-swift-frontend -cache-compile-job %t/a.swift -c @%t/MyApp.cmd -DTEST > %t4.casid +// RUN: %target-swift-frontend-plain -cache-compile-job %t/a.swift -c @%t/MyApp.cmd -DTEST > %t4.casid // RUN: diff %t1.casid %t2.casid // RUN: diff %t1.casid %t3.casid @@ -42,21 +42,21 @@ // RUN: echo "%t/a.swift" > %t/filelist-2 // RUN: echo "%t/b.swift" > %t/filelist-3 // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \ -// RUN: %target-swift-frontend -cache-compile-job -filelist %t/filelist-1 -c @%t/MyApp.cmd > %t5.casid +// RUN: %target-swift-frontend-plain -cache-compile-job -filelist %t/filelist-1 -c @%t/MyApp.cmd > %t5.casid // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \ -// RUN: %target-swift-frontend -cache-compile-job -filelist %t/filelist-2 -c @%t/MyApp.cmd > %t6.casid +// RUN: %target-swift-frontend-plain -cache-compile-job -filelist %t/filelist-2 -c @%t/MyApp.cmd > %t6.casid // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-base-key -- \ -// RUN: %target-swift-frontend -cache-compile-job -filelist %t/filelist-3 -c @%t/MyApp.cmd > %t7.casid +// RUN: %target-swift-frontend-plain -cache-compile-job -filelist %t/filelist-3 -c @%t/MyApp.cmd > %t7.casid // RUN: diff %t5.casid %t6.casid // RUN: not diff %t5.casid %t7.casid /// Test output keys. // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend -cache-compile-job %t/a.swift -emit-module -c -emit-dependencies \ +// RUN: %target-swift-frontend-plain -cache-compile-job %t/a.swift -emit-module -c -emit-dependencies \ // RUN: -emit-tbd -emit-tbd-path %t/test.tbd -o %t/test.o @%t/MyApp.cmd | %FileCheck %s /// Test plugin CAS. -// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-name Test -O \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: %t/a.swift -o %t/plugin_deps.json -cache-compile-job -cas-path %t/cas-plugin -cas-plugin-path %plugin(CASPluginTest) \ // RUN: -cas-plugin-option first-prefix=myfirst- @@ -67,7 +67,7 @@ // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/plugin_deps.json Test > %t/plugin_MyApp.cmd // RUN: %cache-tool -cas-path %t/cas-plugin -cas-plugin-path %plugin(CASPluginTest) \ // RUN: -cas-plugin-option first-prefix=myfirst- -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend -cache-compile-job %t/a.swift -emit-module -c -emit-dependencies \ +// RUN: %target-swift-frontend-plain -cache-compile-job %t/a.swift -emit-module -c -emit-dependencies \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: -emit-tbd -emit-tbd-path %t/test.tbd -o %t/test.o @%t/plugin_MyApp.cmd | %FileCheck %s --check-prefix=CHECK --check-prefix=PLUGIN @@ -78,10 +78,10 @@ /// Check switching CAS plugin path. // RUN: %cache-tool -cas-path %t/cas-plugin -cas-plugin-path %plugin(CASPluginTest) -cas-plugin-option first-prefix=myfirst- -cache-tool-action print-base-key -- \ -// RUN: %target-swift-frontend -cache-compile-job %t/a.swift -c @%t/MyApp-plugin.cmd -cas-path %t/cas-plugin -cas-plugin-path %plugin(CASPluginTest) > %t8.casid +// RUN: %target-swift-frontend-plain -cache-compile-job %t/a.swift -c @%t/MyApp-plugin.cmd -cas-path %t/cas-plugin -cas-plugin-path %plugin(CASPluginTest) > %t8.casid // RUN: cp %plugin(CASPluginTest) %t/libCASPluginTest%llvm_plugin_ext // RUN: %cache-tool -cas-path %t/cas-plugin -cas-plugin-path %t/libCASPluginTest%llvm_plugin_ext -cas-plugin-option first-prefix=myfirst- -cache-tool-action print-base-key -- \ -// RUN: %target-swift-frontend -cache-compile-job %t/a.swift -c @%t/MyApp-plugin.cmd -cas-path %t/cas-plugin -cas-plugin-path %t/libCASPluginTest%llvm_plugin_ext > %t9.casid +// RUN: %target-swift-frontend-plain -cache-compile-job %t/a.swift -c @%t/MyApp-plugin.cmd -cas-path %t/cas-plugin -cas-plugin-path %t/libCASPluginTest%llvm_plugin_ext > %t9.casid // RUN: diff %t8.casid %t9.casid diff --git a/test/CAS/cache_replay.swift b/test/CAS/cache_replay.swift index a561b12824d54..d698c14f5c935 100644 --- a/test/CAS/cache_replay.swift +++ b/test/CAS/cache_replay.swift @@ -22,23 +22,23 @@ // RUN: echo "\"@%t/map.casid\"" >> %t/MyApp.cmd /// Run the command first time, expect cache miss. -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \ // RUN: -module-name Test -o %t/test.o -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --check-prefix=CACHE-MISS %s /// Expect cache hit for second time. -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \ // RUN: -module-name Test -o %t/test.o -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --check-prefix=CACHE-HIT %s /// Expect cache miss a subset of outputs. -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c \ // RUN: -module-name Test -o %t/test.o -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --check-prefix=CACHE-MISS %s /// Cache hit for retry. -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c \ // RUN: -module-name Test -o %t/test.o -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --check-prefix=CACHE-HIT %s /// Skip cache -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job -cache-disable-replay %t/test.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job -cache-disable-replay %t/test.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c \ // RUN: -module-name Test -o %t/test.o -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --allow-empty --check-prefix=SKIP-CACHE %s // CACHE-MISS: remark: cache miss for input diff --git a/test/CAS/cache_replay_multiple_files.swift b/test/CAS/cache_replay_multiple_files.swift index 37d75fa4f5383..9f4dc42a59b6e 100644 --- a/test/CAS/cache_replay_multiple_files.swift +++ b/test/CAS/cache_replay_multiple_files.swift @@ -14,19 +14,19 @@ // RUN: echo "\"-parse-stdlib\"" >> %t/MyApp.cmd /// Test compile multiple inputs with batch mode. -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift %t/foo.swift -emit-module -o %t/Test.swiftmodule \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %t/test.swift %t/foo.swift -emit-module -o %t/Test.swiftmodule \ // RUN: -module-name Test -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --check-prefix=CACHE-MISS %s -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job -primary-file %t/test.swift %t/foo.swift -c -o %t/test.o \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job -primary-file %t/test.swift %t/foo.swift -c -o %t/test.o \ // RUN: -module-name Test -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --check-prefix=CACHE-MISS %s -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift -primary-file %t/foo.swift -c -o %t/foo.o \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %t/test.swift -primary-file %t/foo.swift -c -o %t/foo.o \ // RUN: -module-name Test -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --check-prefix=CACHE-MISS %s /// Expect cache hit second time -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift %t/foo.swift -emit-module -o %t/Test.swiftmodule \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %t/test.swift %t/foo.swift -emit-module -o %t/Test.swiftmodule \ // RUN: -module-name Test -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --check-prefix=CACHE-HIT %s -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job -primary-file %t/test.swift %t/foo.swift -c -o %t/test.o \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job -primary-file %t/test.swift %t/foo.swift -c -o %t/test.o \ // RUN: -module-name Test -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --check-prefix=CACHE-HIT %s -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift -primary-file %t/foo.swift -c -o %t/foo.o \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %t/test.swift -primary-file %t/foo.swift -c -o %t/foo.o \ // RUN: -module-name Test -cas-path %t/cas @%t/MyApp.cmd 2>&1 | %FileCheck --check-prefix=CACHE-HIT %s //--- test.swift diff --git a/test/CAS/cached_diagnostics.swift b/test/CAS/cached_diagnostics.swift index 919c485698f08..a28f455d3a73e 100644 --- a/test/CAS/cached_diagnostics.swift +++ b/test/CAS/cached_diagnostics.swift @@ -6,9 +6,9 @@ // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/MyApp.cmd -b %t/header.cmd -// RUN: %target-swift-frontend @%t/header.cmd %S/Inputs/objc.h -disable-implicit-swift-modules -O -o %t/objc.pch 2>&1 | %FileCheck %s -check-prefix CHECK-BRIDGE +// RUN: %target-swift-frontend-plain @%t/header.cmd %S/Inputs/objc.h -disable-implicit-swift-modules -O -o %t/objc.pch 2>&1 | %FileCheck %s -check-prefix CHECK-BRIDGE // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend @%t/header.cmd %S/Inputs/objc.h -disable-implicit-swift-modules -O -o %t/objc.pch > %t/keys.json +// RUN: %target-swift-frontend-plain @%t/header.cmd %S/Inputs/objc.h -disable-implicit-swift-modules -O -o %t/objc.pch > %t/keys.json // RUN: %{python} %S/Inputs/ExtractOutputKey.py %t/keys.json > %t/key // RUN: echo "\"-disable-implicit-string-processing-module-import\"" >> %t/MyApp.cmd @@ -18,11 +18,13 @@ // RUN: echo "\"-bridging-header-pch-key\"" >> %t/MyApp.cmd // RUN: echo "\"@%t/key\"" >> %t/MyApp.cmd -// RUN: %target-swift-frontend -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %s \ +// RUN: %target-swift-frontend-plain -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %s \ // RUN: -emit-module -o %t/test.swiftmodule 2>&1 | %FileCheck %s -// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- %target-swift-frontend -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %s \ +// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %s \ // RUN: -emit-module -o %t/test.swiftmodule > %t/cache_key.json -// RUN: %cache-tool -cas-path %t/cas -cache-tool-action render-diags %t/cache_key.json -- %target-swift-frontend -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %s \ +// RUN: %cache-tool -cas-path %t/cas -cache-tool-action render-diags %t/cache_key.json -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %s \ // RUN: -emit-module -o %t/test.swiftmodule 2>&1 | %FileCheck %s #warning("this is a warning") // expected-warning {{this is a warning}} @@ -40,16 +42,16 @@ let _ : MyEnum? = .none // expected-warning {{assuming you mean 'Optional&1 | %FileCheck %s -check-prefix CACHE-MISS -// RUN: %target-swift-frontend -c -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %s \ +// RUN: %target-swift-frontend-plain -c -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %s \ // RUN: -typecheck -serialize-diagnostics -serialize-diagnostics-path %t/test.diag -Rcache-compile-job 2>&1 | %FileCheck %s -check-prefix CACHE-HIT // CACHE-MISS: remark: cache miss // CACHE-HIT: remark: replay output file '' diff --git a/test/CAS/cached_diagnostics_macro.swift b/test/CAS/cached_diagnostics_macro.swift index f35adff4a7a05..866d1967fcef4 100644 --- a/test/CAS/cached_diagnostics_macro.swift +++ b/test/CAS/cached_diagnostics_macro.swift @@ -19,7 +19,7 @@ // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/MyApp.cmd -// RUN: %target-swift-frontend -diagnostic-style=swift \ +// RUN: %target-swift-frontend-plain -diagnostic-style=swift \ // RUN: -emit-module -o %t/Test.swiftmodule -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -module-name MyApp -O \ // RUN: -external-plugin-path %t#%swift-plugin-server \ diff --git a/test/CAS/cached_diagnostics_pcm.swift b/test/CAS/cached_diagnostics_pcm.swift index 50040592c1f65..c5187ff8656f2 100644 --- a/test/CAS/cached_diagnostics_pcm.swift +++ b/test/CAS/cached_diagnostics_pcm.swift @@ -22,7 +22,7 @@ // RUN: echo "\"-disable-implicit-string-processing-module-import\"" >> %t/MyApp.cmd // RUN: echo "\"-disable-implicit-concurrency-module-import\"" >> %t/MyApp.cmd -// RUN: %target-swift-frontend -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %t/test.swift \ +// RUN: %target-swift-frontend-plain -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %t/test.swift \ // RUN: -emit-module -o %t/test.swiftmodule //--- module.modulemap diff --git a/test/CAS/cached_diagnostics_remap.swift b/test/CAS/cached_diagnostics_remap.swift index c671a929d7e92..3c6ce7edd2ade 100644 --- a/test/CAS/cached_diagnostics_remap.swift +++ b/test/CAS/cached_diagnostics_remap.swift @@ -7,11 +7,11 @@ // RUN: %t/test.swift -o %t/deps.json -cache-compile-job -cas-path %t/cas -scanner-prefix-map-paths %t /^test -scanner-output-dir %t.noremap // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json bridgingHeader > %t/header.cmd -// RUN: %target-swift-frontend @%t/header.cmd -disable-implicit-swift-modules /^test/objc.h -O -o %t/objc.pch 2>&1 | %FileCheck %s -check-prefix BRIDGE +// RUN: %target-swift-frontend-plain @%t/header.cmd -disable-implicit-swift-modules /^test/objc.h -O -o %t/objc.pch 2>&1 | %FileCheck %s -check-prefix BRIDGE // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend @%t/header.cmd -disable-implicit-swift-modules /^test/objc.h -O -o %t/objc.pch > %t/keys.json +// RUN: %target-swift-frontend-plain @%t/header.cmd -disable-implicit-swift-modules /^test/objc.h -O -o %t/objc.pch > %t/keys.json // RUN: %cache-tool -cas-path %t/cas -cache-tool-action render-diags %t/keys.json -- \ -// RUN: %target-swift-frontend @%t/header.cmd -disable-implicit-swift-modules /^test/objc.h -O -o %t/objc.pch -cache-replay-prefix-map /^test %t 2>&1 \ +// RUN: %target-swift-frontend-plain @%t/header.cmd -disable-implicit-swift-modules /^test/objc.h -O -o %t/objc.pch -cache-replay-prefix-map /^test %t 2>&1 \ // RUN: | %FileCheck %s -check-prefix BRIDGE -check-prefix BRIDGE-REMAP // RUN: %{python} %S/Inputs/ExtractOutputKey.py %t/keys.json > %t/key @@ -26,12 +26,14 @@ // RUN: echo "\"-bridging-header-pch-key\"" >> %t/MyApp.cmd // RUN: echo "\"@%t/key\"" >> %t/MyApp.cmd -// RUN: %target-swift-frontend -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd \ +// RUN: %target-swift-frontend-plain -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd \ // RUN: -emit-module -o %t/test.swiftmodule /^test/test.swift 2>&1 | %FileCheck %s -// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- %target-swift-frontend -cache-compile-job -module-name Test \ +// RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job -module-name Test \ // RUN: -O -cas-path %t/cas @%t/MyApp.cmd \ // RUN: -emit-module -o %t/test.swiftmodule /^test/test.swift > %t/cache_key.json -// RUN: %cache-tool -cas-path %t/cas -cache-tool-action render-diags %t/cache_key.json -- %target-swift-frontend -cache-compile-job -module-name Test \ +// RUN: %cache-tool -cas-path %t/cas -cache-tool-action render-diags %t/cache_key.json -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job -module-name Test \ // RUN: -O -cas-path %t/cas @%t/MyApp.cmd \ // RUN: -emit-module -o %t/test.swiftmodule /^test/test.swift -cache-replay-prefix-map /^test %t 2>&1 | %FileCheck %s --check-prefix REMAP diff --git a/test/CAS/can-import.swift b/test/CAS/can-import.swift index f226d62f9b2fd..f1e3c5b92cc5f 100644 --- a/test/CAS/can-import.swift +++ b/test/CAS/can-import.swift @@ -30,7 +30,7 @@ // CMD-NEXT: "0" // CMD-NEXT: "1000.0.0" -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ diff --git a/test/CAS/cas-explicit-module-map.swift b/test/CAS/cas-explicit-module-map.swift index de0dabdd99873..d6e32f0af7e7d 100644 --- a/test/CAS/cas-explicit-module-map.swift +++ b/test/CAS/cas-explicit-module-map.swift @@ -13,19 +13,19 @@ // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: -module-name Test -explicit-swift-module-map-file @%t/map.casid \ // RUN: %t/Test.swift @%t/MyApp.cmd -// RUN: %target-swift-frontend -emit-module -emit-module-path %t/Foo.swiftmodule -emit-module-interface-path %t/Foo.swiftinterface -disable-implicit-swift-modules \ +// RUN: %target-swift-frontend-plain -emit-module -emit-module-path %t/Foo.swiftmodule -emit-module-interface-path %t/Foo.swiftinterface -disable-implicit-swift-modules \ // RUN: -module-cache-path %t.module-cache -explicit-swift-module-map-file @%t/map.casid %t/Test.swift -cache-compile-job \ // RUN: -cas-path %t/cas -swift-version 5 -enable-library-evolution -o %t/Foo.swiftmodule \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib @%t/MyApp.cmd // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend -emit-module -emit-module-path %t/Foo.swiftmodule -emit-module-interface-path %t/Foo.swiftinterface -disable-implicit-swift-modules \ +// RUN: %target-swift-frontend-plain -emit-module -emit-module-path %t/Foo.swiftmodule -emit-module-interface-path %t/Foo.swiftinterface -disable-implicit-swift-modules \ // RUN: -module-cache-path %t.module-cache -explicit-swift-module-map-file @%t/map.casid %t/Test.swift -cache-compile-job \ // RUN: -cas-path %t/cas -swift-version 5 -enable-library-evolution -o %t/Foo.swiftmodule \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib @%t/MyApp.cmd > %t/keys.json @@ -37,13 +37,13 @@ // CACHE-KEY-NEXT: command-line // CACHE-KEY: Input index: 0 -// RUN: %target-swift-frontend -typecheck-module-from-interface %t/Foo.swiftinterface -disable-implicit-swift-modules \ +// RUN: %target-swift-frontend-plain -typecheck-module-from-interface %t/Foo.swiftinterface -disable-implicit-swift-modules \ // RUN: -module-cache-path %t.module-cache -explicit-swift-module-map-file @%t/map.casid \ // RUN: -cache-compile-job -cas-path %t/cas -swift-version 5 -enable-library-evolution \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: -explicit-interface-module-build -Rcache-compile-job @%t/MyApp.cmd -input-file-key @%t/key 2>&1 \ // RUN: | %FileCheck %s --check-prefix=CACHE-MISS -// RUN: %target-swift-frontend -typecheck-module-from-interface %t/Foo.swiftinterface -disable-implicit-swift-modules \ +// RUN: %target-swift-frontend-plain -typecheck-module-from-interface %t/Foo.swiftinterface -disable-implicit-swift-modules \ // RUN: -module-cache-path %t.module-cache -explicit-swift-module-map-file @%t/map.casid \ // RUN: -cache-compile-job -cas-path %t/cas -swift-version 5 -enable-library-evolution \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ diff --git a/test/CAS/cas_output_backend.swift b/test/CAS/cas_output_backend.swift index 65fdd212da4d5..989ff0b1b7df3 100644 --- a/test/CAS/cas_output_backend.swift +++ b/test/CAS/cas_output_backend.swift @@ -17,9 +17,9 @@ // RUN: not %target-swift-frontend -c -cache-compile-job %s -o %t/test.o @%t/MyApp.cmd 2>&1 | %FileCheck %s --check-prefix=NOT-CONFIG // NOT-CONFIG: error: CAS cannot be initialized from the specified '-cas-*' options: no CAS options provided -// RUN: %target-swift-frontend -c -cache-compile-job -cas-path %t/cas %s -o %t/test.o @%t/MyApp.cmd +// RUN: %target-swift-frontend-plain -c -cache-compile-job -cas-path %t/cas %s -o %t/test.o @%t/MyApp.cmd // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend -c -cache-compile-job -cas-path %t/cas %s -o %t/test.o @%t/MyApp.cmd > %t/cache_key.json +// RUN: %target-swift-frontend-plain -c -cache-compile-job -cas-path %t/cas %s -o %t/test.o @%t/MyApp.cmd > %t/cache_key.json // RUN: %cache-tool -cas-path %t/cas -cache-tool-action validate-outputs %t/cache_key.json /// make sure validate fails if the cas is cleared. diff --git a/test/CAS/cross_import.swift b/test/CAS/cross_import.swift index 4cc2a0e10bc1e..cc5d157d60228 100644 --- a/test/CAS/cross_import.swift +++ b/test/CAS/cross_import.swift @@ -31,7 +31,7 @@ // CMD-NEXT: [[CMI2:[B|C]]] // CMD-NEXT: [[CMI2]].swiftcrossimport{{/|\\}}A.swiftoverlay -// RUN: %target-swift-frontend -emit-module -o %t/Test.swiftmodule \ +// RUN: %target-swift-frontend-plain -emit-module -o %t/Test.swiftmodule \ // RUN: -emit-module-interface-path %t/Test.swiftinterface \ // RUN: -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -enable-cross-import-overlays \ diff --git a/test/CAS/debuginfo_invariant.swift b/test/CAS/debuginfo_invariant.swift index 9b905b427d3cf..0389ae451f0a2 100644 --- a/test/CAS/debuginfo_invariant.swift +++ b/test/CAS/debuginfo_invariant.swift @@ -11,7 +11,7 @@ // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd // RUN: echo %t/main.swift > %t/inputs.FileList -// RUN: %target-swift-frontend -emit-ir -o %t/main.ll -g -O \ +// RUN: %target-swift-frontend-plain -emit-ir -o %t/main.ll -g -O \ // RUN: -cache-compile-job -cas-path %t/cas -swift-version 5 \ // RUN: -disable-implicit-swift-modules -swift-version 5 -enable-cross-import-overlays \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ diff --git a/test/CAS/dependency_file.swift b/test/CAS/dependency_file.swift index e760c7648665f..13877749727d9 100644 --- a/test/CAS/dependency_file.swift +++ b/test/CAS/dependency_file.swift @@ -11,7 +11,7 @@ // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -c -o %t/main.o -cache-compile-job -cas-path %t/cas -Rcache-compile-job \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ @@ -23,7 +23,7 @@ // RUN: %FileCheck %s --check-prefix=DEPS --input-file=%t/main.d -DTMP=%t // DEPS: [[TMP]]{{/|\\}}main.o : -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -c -o %t/main-2.o -cache-compile-job -cas-path %t/cas -Rcache-compile-job \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ @@ -45,7 +45,7 @@ // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map-1.json > %t/map-1.casid // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps-1.json Test > %t/MyApp-1.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -c -o %t/main-3.o -cache-compile-job -cas-path %t/cas -Rcache-compile-job \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ @@ -58,7 +58,7 @@ /// Test replay from driver interface // RUN: %swift-scan-test -action compute_cache_key_from_index -cas-path %t/cas -input 0 -- \ -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -c -o %t/main-4.o -cache-compile-job -cas-path %t/cas -Rcache-compile-job \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ @@ -67,7 +67,7 @@ // RUN: /^tmp/main.swift @%t/MyApp-1.cmd -emit-dependencies -emit-dependencies-path %t/main-4.d > %t/key.casid // RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -- \ -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -c -o %t/main-4.o -cache-compile-job -cas-path %t/cas -Rcache-compile-job \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ diff --git a/test/CAS/embedded-Xcc.swift b/test/CAS/embedded-Xcc.swift index ad6957afa7ea9..23fdefc015f03 100644 --- a/test/CAS/embedded-Xcc.swift +++ b/test/CAS/embedded-Xcc.swift @@ -11,7 +11,7 @@ // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd // RUN: echo %t/main.swift > %t/inputs.FileList -// RUN: %target-swift-frontend -emit-module -o %t/Test.swiftmodule -g -O \ +// RUN: %target-swift-frontend-plain -emit-module -o %t/Test.swiftmodule -g -O \ // RUN: -cache-compile-job -cas-path %t/cas -swift-version 5 \ // RUN: -disable-implicit-swift-modules -swift-version 5 -enable-cross-import-overlays \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ diff --git a/test/CAS/include-tree.swift b/test/CAS/include-tree.swift index 5a3334ed35865..bfb43f36e1775 100644 --- a/test/CAS/include-tree.swift +++ b/test/CAS/include-tree.swift @@ -11,7 +11,7 @@ // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ @@ -19,7 +19,7 @@ // RUN: %t/main.swift @%t/MyApp.cmd /// Test that if there are non-existing module-map file passed through -Xcc, this still compiles. -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ diff --git a/test/CAS/index-store.swift b/test/CAS/index-store.swift index 421fa3e105ad7..fa99575532161 100644 --- a/test/CAS/index-store.swift +++ b/test/CAS/index-store.swift @@ -21,14 +21,14 @@ // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -o %t/Test.swiftmodule \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -o %t/Test.swiftmodule \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: -disable-implicit-swift-modules -explicit-swift-module-map-file @%t/map.casid \ // RUN: -module-name Test -cas-path %t/cas @%t/MyApp.cmd -index-system-modules -index-store-path %t/db 2>&1 | %FileCheck --check-prefix=CACHE-MISS %s // RUN: ls %t/db /// Cache hit with a different index-store-path. Note cache hit will skip replay index data. -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -o %t/Test.swiftmodule \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -o %t/Test.swiftmodule \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: -disable-implicit-swift-modules -explicit-swift-module-map-file @%t/map.casid \ // RUN: -module-name Test -cas-path %t/cas @%t/MyApp.cmd -index-system-modules -index-store-path %t/db2 2>&1 | %FileCheck --check-prefix=CACHE-HIT %s diff --git a/test/CAS/loc-directive-diagnostics.swift b/test/CAS/loc-directive-diagnostics.swift index 5eff153a2d0f0..c69a658a4dd8b 100644 --- a/test/CAS/loc-directive-diagnostics.swift +++ b/test/CAS/loc-directive-diagnostics.swift @@ -9,13 +9,13 @@ // RUN: echo "\"-disable-implicit-concurrency-module-import\"" >> %t/MyApp.cmd // RUN: echo "\"-parse-stdlib\"" >> %t/MyApp.cmd -// RUN: %target-swift-frontend -emit-module -emit-module-path %t/test.module \ +// RUN: %target-swift-frontend-plain -emit-module -emit-module-path %t/test.module \ // RUN: -cache-compile-job -cas-path %t/cas @%t/MyApp.cmd %s 2>&1 | %FileCheck %s // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend -emit-module -emit-module-path %t/test.module -cache-compile-job -cas-path %t/cas \ +// RUN: %target-swift-frontend-plain -emit-module -emit-module-path %t/test.module -cache-compile-job -cas-path %t/cas \ // RUN: @%t/MyApp.cmd %s > %t/cache_key.json // RUN: %cache-tool -cas-path %t/cas -cache-tool-action render-diags %t/cache_key.json -- \ -// RUN: %target-swift-frontend -emit-module -emit-module-path %t/test.module -cache-compile-job -cas-path %t/cas \ +// RUN: %target-swift-frontend-plain -emit-module -emit-module-path %t/test.module -cache-compile-job -cas-path %t/cas \ // RUN: @%t/MyApp.cmd %s 2>&1 | %FileCheck %s #sourceLocation(file: "anything.swift", line: 1) diff --git a/test/CAS/macro_deps.swift b/test/CAS/macro_deps.swift index 51a324a384290..0770cba662de9 100644 --- a/test/CAS/macro_deps.swift +++ b/test/CAS/macro_deps.swift @@ -12,7 +12,7 @@ // RUN: %target-swift-frontend -emit-module -module-cache-path %t/clang-module-cache %t/test.swift -module-name Test -o %t/include/Test.swiftmodule -I %t/include \ // RUN: -O -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -swift-version 5 -external-plugin-path %t#%swift-plugin-server -// RUN: %target-swift-frontend -scan-dependencies -module-load-mode prefer-serialized -module-name MyApp -module-cache-path %t/clang-module-cache -O \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-load-mode prefer-serialized -module-name MyApp -module-cache-path %t/clang-module-cache -O \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -I %t/include \ // RUN: %t/main.swift -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas -external-plugin-path %t#%swift-plugin-server @@ -39,7 +39,7 @@ // PLUGIN_SEARCH-NOT: -external-plugin-path // RESOLVED-COUNT-2: -load-resolved-plugin -// RUN: %target-swift-frontend -diagnostic-style=swift \ +// RUN: %target-swift-frontend-plain -diagnostic-style=swift \ // RUN: -emit-module -o %t/Test.swiftmodule -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -module-name MyApp -O \ // RUN: -external-plugin-path %t#%swift-plugin-server \ diff --git a/test/CAS/macro_option_set.swift b/test/CAS/macro_option_set.swift index f7f29da403d3e..789b7fce279af 100644 --- a/test/CAS/macro_option_set.swift +++ b/test/CAS/macro_option_set.swift @@ -13,7 +13,7 @@ // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/MyApp.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck -verify -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -module-name MyApp -O \ // RUN: -plugin-path %swift-plugin-dir \ diff --git a/test/CAS/macro_plugin.swift b/test/CAS/macro_plugin.swift index f62c7b0af9826..1999c140cef7a 100644 --- a/test/CAS/macro_plugin.swift +++ b/test/CAS/macro_plugin.swift @@ -15,7 +15,7 @@ // RUN: %S/../Macros/Inputs/syntax_macro_definitions.swift \ // RUN: -g -no-toolchain-stdlib-rpath -// RUN: %target-swift-frontend -scan-dependencies -module-load-mode prefer-serialized -module-name MyApp -module-cache-path %t/clang-module-cache -O \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-load-mode prefer-serialized -module-name MyApp -module-cache-path %t/clang-module-cache -O \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: %s -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas -load-plugin-library %t/plugins/%target-library-name(MacroDefinition) @@ -25,7 +25,7 @@ // FS: MacroDefinition // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/MyApp.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck -verify -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -module-name MyApp -O \ // RUN: -load-plugin-library %t/plugins/%target-library-name(MacroDefinition) \ diff --git a/test/CAS/macro_plugin_external.swift b/test/CAS/macro_plugin_external.swift index 8207dadcef972..659263e2f6900 100644 --- a/test/CAS/macro_plugin_external.swift +++ b/test/CAS/macro_plugin_external.swift @@ -35,7 +35,7 @@ // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/MyApp.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck -verify -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -module-name MyApp \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ @@ -61,7 +61,7 @@ // CMD-REMAP-NEXT: -load-resolved-plugin // CMD-REMAP-NEXT: /^test/plugins/[[LIB]]#/^bin/swift-plugin-server#MacroDefinition -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -emit-module -o %t/Macro.swiftmodule -cache-compile-job -cas-path %t/cas \ // RUN: -emit-module-interface-path %t/Macro.swiftinterface \ // RUN: -swift-version 5 -O \ @@ -77,7 +77,7 @@ // MOD: blob data = '/^test/plugins/[[LIB]]#/^bin/swift-plugin-server#MacroDefinition' /// Cache hit has no macro-loading remarks because no macro is actually loaded and the path might not be correct due to different mapping. -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -emit-module -o %t/Macro.swiftmodule -cache-compile-job -cas-path %t/cas \ // RUN: -emit-module-interface-path %t/Macro.swiftinterface \ // RUN: -swift-version 5 -O \ @@ -89,7 +89,7 @@ /// Update timestamp, the build should still work. // RUN: touch %t/plugins/%target-library-name(MacroDefinition) -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -emit-module -o %t/Macro.swiftmodule -cache-compile-job -cas-path %t/cas \ // RUN: -emit-module-interface-path %t/Macro.swiftinterface \ // RUN: -swift-version 5 -O \ @@ -99,7 +99,7 @@ /// Typecheck swift interface with macro plugin. // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -emit-module -o %t/Macro.swiftmodule -cache-compile-job -cas-path %t/cas \ // RUN: -emit-module-interface-path %t/Macro.swiftinterface \ // RUN: -swift-version 5 -O \ @@ -108,7 +108,7 @@ // RUN: /^test/macro.swift @%t/MyApp2.cmd -cache-replay-prefix-map /^test %t -cache-replay-prefix-map /^bin %swift-bin-dir > %t/keys.json // RUN: %{python} %S/Inputs/ExtractOutputKey.py %t/keys.json /^test/macro.swift > %t/key -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck-module-from-interface %t/Macro.swiftinterface \ // RUN: -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -O \ @@ -119,7 +119,7 @@ /// Change the dylib content, this will fail the build. // RUN: echo " " >> %t/plugins/%target-library-name(MacroDefinition) -// RUN: not %target-swift-frontend \ +// RUN: not %target-swift-frontend-plain \ // RUN: -emit-module -o %t/Macro.swiftmodule -cache-compile-job -cas-path %t/cas \ // RUN: -emit-module-interface-path %t/Macro.swiftinterface \ // RUN: -swift-version 5 -O \ diff --git a/test/CAS/module_dep_path.swift b/test/CAS/module_dep_path.swift index 2384030edc3ca..64b5db1c8fee2 100644 --- a/test/CAS/module_dep_path.swift +++ b/test/CAS/module_dep_path.swift @@ -18,7 +18,7 @@ // RUN: llvm-cas --cas %t/cas --make-blob --data %t/B-map.json > %t/B-map.casid // RUN: echo %t/B.swift > %t/inputs.FileList -// RUN: %target-swift-frontend -emit-module -o %t/B.swiftmodule -g \ +// RUN: %target-swift-frontend-plain -emit-module -o %t/B.swiftmodule -g \ // RUN: -cache-compile-job -cas-path %t/cas -swift-version 6 \ // RUN: -module-name B -swift-module-file=A=@%t/A.casid \ // RUN: -explicit-swift-module-map-file @%t/B-map.casid \ @@ -35,7 +35,7 @@ // RUN: rm %t/A.swiftmodule %t/A.swift // RUN: echo %s > %t/inputs.FileList -// RUN: %target-swift-frontend -emit-module -o %t/Main.swiftmodule -g \ +// RUN: %target-swift-frontend-plain -emit-module -o %t/Main.swiftmodule -g \ // RUN: -cache-compile-job -cas-path %t/cas -swift-version 6 \ // RUN: -module-name Main -swift-module-file=B=@%t/B.casid \ // RUN: -explicit-swift-module-map-file @%t/map.casid \ diff --git a/test/CAS/module_trace.swift b/test/CAS/module_trace.swift index 3ee67dff70815..f9b21be32afee 100644 --- a/test/CAS/module_trace.swift +++ b/test/CAS/module_trace.swift @@ -11,7 +11,7 @@ // RUN: -emit-module-interface-path %t/A.swiftinterface -enable-library-evolution -I %t \ // RUN: %t/A.swift -// RUN: %target-swift-frontend -scan-dependencies -module-name Test -module-cache-path %t/clang-module-cache %t/main.swift \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-name Test -module-cache-path %t/clang-module-cache %t/main.swift \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: -o %t/deps.json -I %t -cache-compile-job -cas-path %t/cas -swift-version 5 @@ -27,7 +27,7 @@ // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -c -cache-compile-job -cas-path %t/cas \ // RUN: -disable-implicit-swift-modules -o %t/test.o\ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ diff --git a/test/CAS/no-cas-path-dependency.swift b/test/CAS/no-cas-path-dependency.swift index 121318aa33c7b..85c22c0283174 100644 --- a/test/CAS/no-cas-path-dependency.swift +++ b/test/CAS/no-cas-path-dependency.swift @@ -14,7 +14,7 @@ // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -c -cache-compile-job -cas-path %t/cas \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ @@ -40,7 +40,7 @@ // RUN: llvm-cas --cas %t/cas-2 --make-blob --data %t/map-2.json > %t/map-2.casid // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps-2.json Test > %t/MyApp-2.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -c -cache-compile-job -cas-path %t/cas-2 \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ diff --git a/test/CAS/opt-record.swift b/test/CAS/opt-record.swift index 11a2a7854e7b1..0014b4ae32d0a 100644 --- a/test/CAS/opt-record.swift +++ b/test/CAS/opt-record.swift @@ -6,13 +6,13 @@ // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/MyApp.cmd -// RUN: %target-swift-frontend -c -cache-compile-job -cas-path %t/cas -O \ +// RUN: %target-swift-frontend-plain -c -cache-compile-job -cas-path %t/cas -O \ // RUN: -save-optimization-record -save-optimization-record-path %t/record.yaml \ // RUN: -swift-version 5 -module-name Test \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: @%t/MyApp.cmd %s -o %t/test.o -Rcache-compile-job 2>&1 | %FileCheck %s --check-prefix=CACHE-MISS -// RUN: %target-swift-frontend -c -cache-compile-job -cas-path %t/cas -O \ +// RUN: %target-swift-frontend-plain -c -cache-compile-job -cas-path %t/cas -O \ // RUN: -save-optimization-record -save-optimization-record-path %t/record-1.yaml \ // RUN: -swift-version 5 -module-name Test \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ diff --git a/test/CAS/reproducer.swift b/test/CAS/reproducer.swift index 3805c738bbfdd..74b102c68c5c6 100644 --- a/test/CAS/reproducer.swift +++ b/test/CAS/reproducer.swift @@ -1,7 +1,7 @@ // RUN: %empty-directory(%t) // RUN: split-file %s %t -// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O -module-cache-path %t/clang-module-cache \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-name Test -O -module-cache-path %t/clang-module-cache \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: -import-objc-header %t/Bridging.h -scanner-output-dir %t -auto-bridging-header-chaining -scanner-debug-write-output \ // RUN: %t/test.swift %t/foo.swift -I %t/include -o %t/deps.json -cache-compile-job -cas-path %t/cas @@ -9,9 +9,10 @@ // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/MyApp.cmd -b %t/header.cmd // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json bridgingHeader > %t/header.cmd -// RUN: %target-swift-frontend @%t/header.cmd %t/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch +// RUN: %target-swift-frontend-plain @%t/header.cmd %t/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend @%t/header.cmd %t/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch > %t/keys.json +// RUN: %target-swift-frontend-plain @%t/header.cmd %t/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch > %t/keys.json + // RUN: %{python} %S/Inputs/ExtractOutputKey.py %t/keys.json > %t/key // RUN: echo "\"-disable-implicit-string-processing-module-import\"" >> %t/MyApp.cmd @@ -23,7 +24,7 @@ // RUN: echo "\"-bridging-header-pch-key\"" >> %t/MyApp.cmd // RUN: echo "\"@%t/key\"" >> %t/MyApp.cmd -// RUN: %target-swift-frontend %t/test.swift %t/foo.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c \ +// RUN: %target-swift-frontend-plain %t/test.swift %t/foo.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c \ // RUN: -module-name Test -o %t/test.o -cache-compile-job -cas-path %t/cas @%t/MyApp.cmd -gen-reproducer -gen-reproducer-dir %t/crash // RUN: %FileCheck %s --input-file=%t/crash/reproduce.sh diff --git a/test/CAS/swift-scan-diagnostics-batch.swift b/test/CAS/swift-scan-diagnostics-batch.swift index 16a6444e88906..6461f846ca2ae 100644 --- a/test/CAS/swift-scan-diagnostics-batch.swift +++ b/test/CAS/swift-scan-diagnostics-batch.swift @@ -1,7 +1,7 @@ // RUN: %empty-directory(%t) // RUN: split-file %s %t -// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-name Test -O \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: %t/a.swift %t/b.swift %t/c.swift -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas @@ -11,26 +11,27 @@ // RUN: echo "\"-parse-stdlib\"" >> %t/MyApp.cmd // RUN: %swift-scan-test -action compute_cache_key_from_index -cas-path %t/cas -input 0 -- \ -// RUN: %target-swift-frontend -cache-compile-job -primary-file %t/a.swift -primary-file %t/b.swift %t/c.swift \ +// RUN: %target-swift-frontend-plain -cache-compile-job -primary-file %t/a.swift -primary-file %t/b.swift %t/c.swift \ // RUN: -c -emit-dependencies -module-name Test -o %t/a.o -o %t/b.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd > %t/key0.casid // RUN: %swift-scan-test -action compute_cache_key_from_index -cas-path %t/cas -input 1 -- \ -// RUN: %target-swift-frontend -cache-compile-job -primary-file %t/a.swift -primary-file %t/b.swift %t/c.swift \ +// RUN: %target-swift-frontend-plain -cache-compile-job -primary-file %t/a.swift -primary-file %t/b.swift %t/c.swift \ // RUN: -c -emit-dependencies -module-name Test -o %t/a.o -o %t/b.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd > %t/key1.casid -// RUN: %target-swift-frontend -cache-compile-job \ +// RUN: %target-swift-frontend-plain -cache-compile-job \ // RUN: -primary-file %t/a.swift -primary-file %t/b.swift %t/c.swift \ // RUN: -c -emit-dependencies \ // RUN: -module-name Test -o %t/a.o -o %t/b.o -cas-path %t/cas @%t/MyApp.cmd -// RUN: %target-swift-frontend -cache-compile-job \ +// RUN: %target-swift-frontend-plain -cache-compile-job \ // RUN: %t/a.swift %t/b.swift -primary-file %t/c.swift \ // RUN: -c -emit-dependencies \ // RUN: -module-name Test -o %t/c.o -cas-path %t/cas @%t/MyApp.cmd -// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key0.casid -- %target-swift-frontend -cache-compile-job \ +// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key0.casid -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job \ // RUN: -primary-file %t/a.swift -primary-file %t/b.swift %t/c.swift \ // RUN: -c -emit-dependencies -module-name Test -o %t/a2.o -o %t/b2.o -cas-path %t/cas \ // RUN: -serialize-diagnostics -serialize-diagnostics-path %t/a2.dia -serialize-diagnostics-path %t/b2.dia \ @@ -42,7 +43,8 @@ // A-WARN: warning: This is a warning // B-WARN: warning: This is also a warning -// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key1.casid -- %target-swift-frontend -cache-compile-job \ +// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key1.casid -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job \ // RUN: -primary-file %t/a.swift -primary-file %t/b.swift %t/c.swift \ // RUN: -c -emit-dependencies -module-name Test -o %t/a2.o -o %t/b2.o -cas-path %t/cas \ // RUN: -serialize-diagnostics -serialize-diagnostics-path %t/a2.dia -serialize-diagnostics-path %t/b2.dia \ diff --git a/test/CAS/swift-scan-diagnostics.swift b/test/CAS/swift-scan-diagnostics.swift index 6f6fa8cd345c0..2c24df2b14468 100644 --- a/test/CAS/swift-scan-diagnostics.swift +++ b/test/CAS/swift-scan-diagnostics.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) -// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-name Test -O \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: %s -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas @@ -9,11 +9,13 @@ // RUN: echo "\"-disable-implicit-concurrency-module-import\"" >> %t/MyApp.cmd // RUN: echo "\"-parse-stdlib\"" >> %t/MyApp.cmd -// RUN: %swift-scan-test -action compute_cache_key -cas-path %t/cas -input %s -- %target-swift-frontend -cache-compile-job %s \ +// RUN: %swift-scan-test -action compute_cache_key -cas-path %t/cas -input %s -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies -module-name Test -o %t/test.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd > %t/key.casid -// RUN: %swift-scan-test -action compute_cache_key_from_index -cas-path %t/cas -input 0 -- %target-swift-frontend -cache-compile-job %s \ +// RUN: %swift-scan-test -action compute_cache_key_from_index -cas-path %t/cas -input 0 -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies -module-name Test -o %t/test.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd > %t/key1.casid @@ -21,13 +23,14 @@ // RUN: not %swift-scan-test -action cache_query -id @%t/key.casid -cas-path %t/cas 2>&1 | %FileCheck %s --check-prefix=CHECK-QUERY-NOT-FOUND -// RUN: %target-swift-frontend -cache-compile-job %s -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \ +// RUN: %target-swift-frontend-plain -cache-compile-job %s -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \ // RUN: -serialize-diagnostics -serialize-diagnostics-path %t/test.dia \ // RUN: -module-name Test -o %t/test.o -cas-path %t/cas @%t/MyApp.cmd // RUN: %swift-scan-test -action cache_query -id @%t/key.casid -cas-path %t/cas | %FileCheck %s --check-prefix=CHECK-QUERY -// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -- %target-swift-frontend -cache-compile-job %s \ +// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test2.swiftmodule -c -emit-dependencies -module-name Test -o %t/test2.o -cas-path %t/cas \ // RUN: -serialize-diagnostics -serialize-diagnostics-path %t/test2.dia \ // RUN: @%t/MyApp.cmd @@ -43,7 +46,8 @@ // CHECK-QUERY-NEXT: swiftmodule: llvmcas:// // CHECK-QUERY-NEXT: cached-diagnostics: llvmcas:// -// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -- %target-swift-frontend -cache-compile-job %s \ +// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test2.swiftmodule -c -emit-dependencies -module-name Test -o %t/test2.o -cas-path %t/cas \ // RUN: -frontend-parseable-output -serialize-diagnostics -serialize-diagnostics-path %t/test3.dia \ // RUN: @%t/MyApp.cmd 2>&1 | %FileCheck %s --check-prefix=PARSEABLE diff --git a/test/CAS/swift-scan-response-file.swift b/test/CAS/swift-scan-response-file.swift index 1f89b0604927c..bf66e3f15e9bf 100644 --- a/test/CAS/swift-scan-response-file.swift +++ b/test/CAS/swift-scan-response-file.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) -// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-name Test -O \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: %s -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas @@ -9,7 +9,7 @@ // RUN: echo "\"-disable-implicit-concurrency-module-import\"" >> %t/MyApp.cmd // RUN: echo "\"-parse-stdlib\"" >> %t/MyApp.cmd -// RUN: %{python} %S/Inputs/PrintResponseFile.py %target-swift-frontend -cache-compile-job -Rcache-compile-job %s \ +// RUN: %{python} %S/Inputs/PrintResponseFile.py %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies -module-name Test -o %t/test.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd > %t/cmd.resp @@ -25,7 +25,7 @@ // RUN: %swift-scan-test -action cache_query -id @%t/key.casid -cas-path %t/cas | %FileCheck %s --check-prefix=CHECK-QUERY -// RUN: %{python} %S/Inputs/PrintResponseFile.py %target-swift-frontend -cache-compile-job -Rcache-compile-job %s \ +// RUN: %{python} %S/Inputs/PrintResponseFile.py %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test2.swiftmodule -c -emit-dependencies -module-name Test -o %t/test.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd > %t/cmd2.resp // RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -- %swift_frontend_plain @%t/cmd2.resp diff --git a/test/CAS/swift-scan-test-llvm-args.swift b/test/CAS/swift-scan-test-llvm-args.swift index 9ee817f5253e9..24ee0ba46a73b 100644 --- a/test/CAS/swift-scan-test-llvm-args.swift +++ b/test/CAS/swift-scan-test-llvm-args.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) -// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-name Test -O \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: %s -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas @@ -9,18 +9,20 @@ // RUN: echo "\"-disable-implicit-concurrency-module-import\"" >> %t/MyApp.cmd // RUN: echo "\"-parse-stdlib\"" >> %t/MyApp.cmd -// RUN: %swift-scan-test -action compute_cache_key -cas-path %t/cas -input %s -- %target-swift-frontend -cache-compile-job -Rcache-compile-job %s \ +// RUN: %swift-scan-test -action compute_cache_key -cas-path %t/cas -input %s -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies -module-name Test -o %t/test.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd -Xllvm -aarch64-use-tbi > %t/key.casid // RUN: not %swift-scan-test -action cache_query -id @%t/key.casid -cas-path %t/cas 2>&1 | %FileCheck %s --check-prefix=CHECK-QUERY-NOT-FOUND -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %s -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %s -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \ // RUN: -module-name Test -o %t/test.o -cas-path %t/cas @%t/MyApp.cmd -Xllvm -aarch64-use-tbi // RUN: %swift-scan-test -action cache_query -id @%t/key.casid -cas-path %t/cas | %FileCheck %s --check-prefix=CHECK-QUERY -// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -threads 10 -- %target-swift-frontend -cache-compile-job -Rcache-compile-job %s \ +// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -threads 10 -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test2.swiftmodule -c -emit-dependencies -module-name Test -o %t/test2.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd -Xllvm -aarch64-use-tbi diff --git a/test/CAS/swift-scan-test.swift b/test/CAS/swift-scan-test.swift index c95b44cec6727..caf4e764d9822 100644 --- a/test/CAS/swift-scan-test.swift +++ b/test/CAS/swift-scan-test.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) -// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-name Test -O \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ // RUN: %s -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas @@ -9,11 +9,13 @@ // RUN: echo "\"-disable-implicit-concurrency-module-import\"" >> %t/MyApp.cmd // RUN: echo "\"-parse-stdlib\"" >> %t/MyApp.cmd -// RUN: %swift-scan-test -action compute_cache_key -cas-path %t/cas -input %s -- %target-swift-frontend -cache-compile-job -Rcache-compile-job %s \ +// RUN: %swift-scan-test -action compute_cache_key -cas-path %t/cas -input %s -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies -module-name Test -o %t/test.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd > %t/key.casid -// RUN: %swift-scan-test -action compute_cache_key_from_index -cas-path %t/cas -input 0 -- %target-swift-frontend -cache-compile-job -Rcache-compile-job %s \ +// RUN: %swift-scan-test -action compute_cache_key_from_index -cas-path %t/cas -input 0 -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies -module-name Test -o %t/test.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd > %t/key1.casid @@ -21,12 +23,13 @@ // RUN: not %swift-scan-test -action cache_query -id @%t/key.casid -cas-path %t/cas 2>&1 | %FileCheck %s --check-prefix=CHECK-QUERY-NOT-FOUND -// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %s -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %s -emit-module -emit-module-path %t/Test.swiftmodule -c -emit-dependencies \ // RUN: -module-name Test -o %t/test.o -cas-path %t/cas @%t/MyApp.cmd // RUN: %swift-scan-test -action cache_query -id @%t/key.casid -cas-path %t/cas | %FileCheck %s --check-prefix=CHECK-QUERY -// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -- %target-swift-frontend -cache-compile-job -Rcache-compile-job %s \ +// RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -- \ +// RUN: %target-swift-frontend-plain -cache-compile-job -Rcache-compile-job %s \ // RUN: -emit-module -emit-module-path %t/Test2.swiftmodule -c -emit-dependencies -module-name Test -o %t/test2.o -cas-path %t/cas \ // RUN: @%t/MyApp.cmd diff --git a/test/CAS/symbol-graph.swift b/test/CAS/symbol-graph.swift index 41fe1897e0123..dad4164e1886c 100644 --- a/test/CAS/symbol-graph.swift +++ b/test/CAS/symbol-graph.swift @@ -1,7 +1,7 @@ // RUN: %empty-directory(%t) // RUN: split-file %s %t -// RUN: %target-swift-frontend -scan-dependencies -module-name Test -module-cache-path %t/clang-module-cache -O \ +// RUN: %target-swift-frontend-plain -scan-dependencies -module-name Test -module-cache-path %t/clang-module-cache -O \ // RUN: -parse-stdlib -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: %t/main.swift -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas -I %t/include \ // RUN: -emit-symbol-graph -emit-symbol-graph-dir %t/symbol-graph1 @@ -11,8 +11,10 @@ // RUN: %{python} %S/Inputs/GenerateExplicitModuleMap.py %t/deps.json > %t/map.json // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid + // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/Test.cmd -// RUN: %target-swift-frontend -module-name Test -module-cache-path %t/clang-module-cache -O \ + +// RUN: %target-swift-frontend-plain -module-name Test -module-cache-path %t/clang-module-cache -O \ // RUN: -parse-stdlib -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: %t/main.swift -o %t/Test.swiftmodule -swift-version 5 -cache-compile-job -cas-path %t/cas -I %t/include \ // RUN: -explicit-swift-module-map-file @%t/map.casid \ @@ -22,7 +24,8 @@ // CACHE-MISS: remark: cache miss for input // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/Test.cmd -// RUN: %target-swift-frontend -module-name Test -module-cache-path %t/clang-module-cache -O \ + +// RUN: %target-swift-frontend-plain -module-name Test -module-cache-path %t/clang-module-cache -O \ // RUN: -parse-stdlib -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: %t/main.swift -o %t/Test.swiftmodule -swift-version 5 -cache-compile-job -cas-path %t/cas -I %t/include \ // RUN: -explicit-swift-module-map-file @%t/map.casid \ @@ -36,7 +39,7 @@ /// Test replay from driver interface // RUN: %swift-scan-test -action compute_cache_key_from_index -cas-path %t/cas -input 0 -- \ -// RUN: %target-swift-frontend -module-name Test -module-cache-path %t/clang-module-cache -O \ +// RUN: %target-swift-frontend-plain -module-name Test -module-cache-path %t/clang-module-cache -O \ // RUN: -parse-stdlib -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: %t/main.swift -o %t/Test.swiftmodule -swift-version 5 -cache-compile-job -cas-path %t/cas -I %t/include \ // RUN: -explicit-swift-module-map-file @%t/map.casid \ @@ -44,7 +47,7 @@ // RUN: -emit-module @%t/Test.cmd -Rcache-compile-job > %t/key.casid // RUN: %swift-scan-test -action replay_result -cas-path %t/cas -id @%t/key.casid -- \ -// RUN: %target-swift-frontend -module-name Test -module-cache-path %t/clang-module-cache -O \ +// RUN: %target-swift-frontend-plain -module-name Test -module-cache-path %t/clang-module-cache -O \ // RUN: -parse-stdlib -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: %t/main.swift -o %t/Test.swiftmodule -swift-version 5 -cache-compile-job -cas-path %t/cas -I %t/include \ // RUN: -explicit-swift-module-map-file @%t/map.casid \ diff --git a/test/CAS/uncached-casfs.swift b/test/CAS/uncached-casfs.swift index d4ffa903e3d2a..80fb6b550ba93 100644 --- a/test/CAS/uncached-casfs.swift +++ b/test/CAS/uncached-casfs.swift @@ -9,9 +9,9 @@ // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/MyApp.cmd -b %t/header.cmd // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json bridgingHeader > %t/header.cmd -// RUN: %target-swift-frontend @%t/header.cmd %t/base/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch +// RUN: %target-swift-frontend-plain @%t/header.cmd %t/base/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-output-keys -- \ -// RUN: %target-swift-frontend @%t/header.cmd %t/base/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch > %t/keys.json +// RUN: %target-swift-frontend-plain @%t/header.cmd %t/base/Bridging.h -disable-implicit-swift-modules -O -o %t/bridging.pch > %t/keys.json // RUN: %{python} %S/Inputs/ExtractOutputKey.py %t/keys.json > %t/key // RUN: echo "\"-disable-implicit-string-processing-module-import\"" >> %t/MyApp.cmd @@ -25,7 +25,7 @@ // RUN: sed -e "s@VFS_DIR@%{/t:regex_replacement}/base@g" -e "s@EXTERNAL_DIR@%{/t:regex_replacement}/modified@g" %t/base.yaml > %t/overlay.yaml -// RUN: %target-swift-frontend %t/base/test.swift %t/base/foo.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c \ +// RUN: %target-swift-frontend-plain %t/base/test.swift %t/base/foo.swift -O -emit-module -emit-module-path %t/Test.swiftmodule -c \ // RUN: -module-name Test -o %t/test.o -cas-path %t/cas @%t/MyApp.cmd -vfsoverlay %t/overlay.yaml -module-import-from-cas diff --git a/test/CAS/vfsoverlay.swift b/test/CAS/vfsoverlay.swift index 89d1d032cde5a..a49efda5d9b79 100644 --- a/test/CAS/vfsoverlay.swift +++ b/test/CAS/vfsoverlay.swift @@ -21,7 +21,7 @@ // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd -// RUN: %target-swift-frontend \ +// RUN: %target-swift-frontend-plain \ // RUN: -typecheck -cache-compile-job -cas-path %t/cas -vfsoverlay %t/overlay.yaml \ // RUN: -swift-version 5 -disable-implicit-swift-modules \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ diff --git a/test/lit.cfg b/test/lit.cfg index 0b251588f60ae..c4dc03997b458 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -1620,6 +1620,7 @@ if run_vendor == 'apple': (config.swift_frontend, target_options, config.variant_sdk, maccatalyst_extra_frameworks, config.swift_test_options, config.swift_frontend_test_options, swift_frontend_platform_remap_config)) + config.target_swift_frontend_plain = "%s %s" % (config.swift_frontend, target_options) subst_target_swift_frontend_mock_sdk = ( "%s %s -sdk %r %s %s %s" % (config.swift_frontend, target_options_for_mock_sdk, config.variant_sdk, @@ -1763,6 +1764,12 @@ elif run_os in ['windows-msvc']: config.swift_test_options, \ config.swift_frontend_test_options)) + config.target_swift_frontend_plain = \ + "%r -target %s %s %s" % (config.swift_frontend, \ + config.variant_triple, \ + config.resource_dir_opt, \ + mcp_opt) + config.target_codesign = 'echo' subst_target_swift_frontend_mock_sdk = config.target_swift_frontend @@ -2924,6 +2931,7 @@ config.substitutions.append(('%target-swift-frontend\(mock-sdk:([^)]+)\)', SubstituteCaptures(r'%s \1 %s' % ( escape_for_substitute_captures(subst_target_swift_frontend_mock_sdk), escape_for_substitute_captures(subst_target_swift_frontend_mock_sdk_after))))) +config.substitutions.append(('%target-swift-frontend-plain', config.target_swift_frontend_plain)) config.substitutions.append(('%target-swift-frontend', config.target_swift_frontend)) From b031f7e4a87c7c332576e6f0477939f2ed9fde8c Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 10 Dec 2025 14:47:07 -0800 Subject: [PATCH 2/7] test: enable CAS tests on Windows Enable the CAS test suite to execute on Windows. --- test/CAS/lit.local.cfg | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/CAS/lit.local.cfg b/test/CAS/lit.local.cfg index 00afab7dfcd5b..2c2b881b683bb 100644 --- a/test/CAS/lit.local.cfg +++ b/test/CAS/lit.local.cfg @@ -12,7 +12,3 @@ if get_target_os() in ('windows-msvc',): config.substitutions.insert(0, (r'%plugin\(([^)]+)\)', SubstituteCaptures(os.path.join(config.llvm_tools_dir, r'%target-library-name(\1)')))) else: config.substitutions.insert(0, (r'%plugin\(([^)]+)\)', SubstituteCaptures(os.path.join(config.llvm_libs_dir, r'%target-library-name(\1)')))) - -import platform -if platform.system() == 'Windows': - config.unsupported = True From e7addfcb3f9128ea17f140b7dd249fb4aec13a5e Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 10 Dec 2025 21:27:51 -0800 Subject: [PATCH 3/7] test: migrate additional tests to `swift-build-modules` Migrate two more instances of the lit test `RUN` lines to `swift-build-modules` to ensure that all the modules are available for the CAS build. --- test/CAS/coverage-dir.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/CAS/coverage-dir.swift b/test/CAS/coverage-dir.swift index 7e306d8ae0acc..70c2e30490463 100644 --- a/test/CAS/coverage-dir.swift +++ b/test/CAS/coverage-dir.swift @@ -5,10 +5,8 @@ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: %t/main.swift -o %t/deps.json -cache-compile-job -cas-path %t/cas -profile-coverage-mapping -profile-generate -// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftShims > %t/shim.cmd -// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json A > %t/A.cmd +// RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/A.cmd -// RUN: %FileCheck %s --input-file=%t/shim.cmd // RUN: %FileCheck %s --input-file=%t/A.cmd // CHECK: -direct-clang-cc1-module-build From d7247bbe20ab246b0b404288aa140aa13cf3bad0 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 10 Dec 2025 21:30:33 -0800 Subject: [PATCH 4/7] test: accommodate path separators in CAS tests Adjust the test expectations to account for path separators on Windows. --- test/CAS/block-list.swift | 4 ++-- test/CAS/cached_diagnostics_remap.swift | 4 ++-- test/CAS/macro_plugin_external.swift | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/CAS/block-list.swift b/test/CAS/block-list.swift index 2c67c919bea3d..e8ed61f51b435 100644 --- a/test/CAS/block-list.swift +++ b/test/CAS/block-list.swift @@ -12,9 +12,9 @@ // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json A > %t/A.cmd // RUN: %FileCheck %s -check-prefix CMD -input-file=%t/A.cmd // CMD: -blocklist-file -// CMD-NEXT: /^tmp/blocklist.yml +// CMD-NEXT: /^tmp{{/|\\}}blocklist.yml // CMD-NEXT: -blocklist-file -// CMD-NEXT: /^tmp/empty.yml +// CMD-NEXT: /^tmp{{/|\\}}empty.yml // RUN: %{python} %S/Inputs/SwiftDepsExtractor.py %t/deps.json Test casFSRootID > %t/fs.casid // DISABLE: llvm-cas --cas %t/cas --ls-tree-recursive @%t/fs.casid | %FileCheck %s -check-prefix FS diff --git a/test/CAS/cached_diagnostics_remap.swift b/test/CAS/cached_diagnostics_remap.swift index 3c6ce7edd2ade..04508cd0b316d 100644 --- a/test/CAS/cached_diagnostics_remap.swift +++ b/test/CAS/cached_diagnostics_remap.swift @@ -37,9 +37,9 @@ // RUN: -O -cas-path %t/cas @%t/MyApp.cmd \ // RUN: -emit-module -o %t/test.swiftmodule /^test/test.swift -cache-replay-prefix-map /^test %t 2>&1 | %FileCheck %s --check-prefix REMAP -// BRIDGE: /^test/objc.h:3:2: warning: warning in bridging header +// BRIDGE: {{/|\\}}^test{{/|\\}}objc.h:3:2: warning: warning in bridging header // BRIDGE-REMAP: TMP_DIR{{/|\\}}objc.h:3:2: warning: warning in bridging header -// CHECK: /^test/test.swift:1:10: warning: this is a warning +// CHECK: {{/|\\}}^test{{/|\\}}test.swift:1:10: warning: this is a warning // REMAP: TMP_DIR{{/|\\}}test.swift:1:10: warning: this is a warning //--- test.swift diff --git a/test/CAS/macro_plugin_external.swift b/test/CAS/macro_plugin_external.swift index 659263e2f6900..51f317586a486 100644 --- a/test/CAS/macro_plugin_external.swift +++ b/test/CAS/macro_plugin_external.swift @@ -50,7 +50,7 @@ // RUN: %cache-tool -cas-path %t/cas -cache-tool-action print-include-tree-list @%t/fs.casid | %FileCheck %s --check-prefix=FS-REMAP -DLIB=%target-library-name(MacroDefinition) /// CASFS is remapped. -// FS-REMAP: /^test/plugins/[[LIB]] +// FS-REMAP: /^test{{/|\\}}plugins{{/|\\}}[[LIB]] // RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps2.json -o %t/MyApp2.cmd @@ -59,7 +59,7 @@ // CMD-REMAP: -resolved-plugin-verification // CMD-REMAP-NEXT: -load-resolved-plugin -// CMD-REMAP-NEXT: /^test/plugins/[[LIB]]#/^bin/swift-plugin-server#MacroDefinition +// CMD-REMAP-NEXT: /^test{{/|\\}}plugins{{/|\\}}[[LIB]]#/^bin{{/|\\}}swift-plugin-server#MacroDefinition // RUN: %target-swift-frontend-plain \ // RUN: -emit-module -o %t/Macro.swiftmodule -cache-compile-job -cas-path %t/cas \ @@ -74,7 +74,7 @@ /// Encoded PLUGIN_SEARCH_OPTION is remapped. // RUN: llvm-bcanalyzer -dump %t/Macro.swiftmodule | %FileCheck %s --check-prefix=MOD -DLIB=%target-library-name(MacroDefinition) -// MOD: blob data = '/^test/plugins/[[LIB]]#/^bin/swift-plugin-server#MacroDefinition' +// MOD: blob data = '/^test{{/|\\}}plugins{{/|\\}}[[LIB]]#/^bin{{/|\\}}swift-plugin-server#MacroDefinition' /// Cache hit has no macro-loading remarks because no macro is actually loaded and the path might not be correct due to different mapping. // RUN: %target-swift-frontend-plain \ From 6ea75046939f8afaea7847db7ee18bff084c313a Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 10 Dec 2025 21:31:19 -0800 Subject: [PATCH 5/7] test: acount for plugin extension on Windows The plugin server on Windows is an executable and thus has the `.exe` extension that we did not match. Adjust the test for this naming difference. --- test/CAS/macro_plugin_external.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/CAS/macro_plugin_external.swift b/test/CAS/macro_plugin_external.swift index 51f317586a486..9efcba39d7629 100644 --- a/test/CAS/macro_plugin_external.swift +++ b/test/CAS/macro_plugin_external.swift @@ -59,7 +59,7 @@ // CMD-REMAP: -resolved-plugin-verification // CMD-REMAP-NEXT: -load-resolved-plugin -// CMD-REMAP-NEXT: /^test{{/|\\}}plugins{{/|\\}}[[LIB]]#/^bin{{/|\\}}swift-plugin-server#MacroDefinition +// CMD-REMAP-NEXT: /^test{{/|\\}}plugins{{/|\\}}[[LIB]]#/^bin{{/|\\}}swift-plugin-server{{(.exe)?}}#MacroDefinition // RUN: %target-swift-frontend-plain \ // RUN: -emit-module -o %t/Macro.swiftmodule -cache-compile-job -cas-path %t/cas \ @@ -74,7 +74,7 @@ /// Encoded PLUGIN_SEARCH_OPTION is remapped. // RUN: llvm-bcanalyzer -dump %t/Macro.swiftmodule | %FileCheck %s --check-prefix=MOD -DLIB=%target-library-name(MacroDefinition) -// MOD: blob data = '/^test{{/|\\}}plugins{{/|\\}}[[LIB]]#/^bin{{/|\\}}swift-plugin-server#MacroDefinition' +// MOD: blob data = '/^test{{/|\\}}plugins{{/|\\}}[[LIB]]#/^bin{{/|\\}}swift-plugin-server{{(.exe)?}}#MacroDefinition' /// Cache hit has no macro-loading remarks because no macro is actually loaded and the path might not be correct due to different mapping. // RUN: %target-swift-frontend-plain \ From fd128debea2f7b8f18b8b1183c226d1ae86ef070 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 11 Dec 2025 15:13:44 -0800 Subject: [PATCH 6/7] swift-scan-test: adjust frontend detection for Windows Ensure that we account for file system arc separators and extensions by using the LLVM functions rather than trying to simply do string matching. This allows us to properly handle the inputs on Windows. --- tools/swift-scan-test/swift-scan-test.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/swift-scan-test/swift-scan-test.cpp b/tools/swift-scan-test/swift-scan-test.cpp index 7509d19c4d5e9..f2f953b801bb6 100644 --- a/tools/swift-scan-test/swift-scan-test.cpp +++ b/tools/swift-scan-test/swift-scan-test.cpp @@ -23,6 +23,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Path.h" #include "llvm/Support/StringSaver.h" #include "llvm/Support/ThreadPool.h" @@ -264,8 +265,12 @@ static int action_scan_dependency(std::vector &Args, static std::vector createArgs(ArrayRef Cmd, StringSaver &Saver, Actions Action) { - if (!Cmd.empty() && StringRef(Cmd.front()).ends_with("swift-frontend")) - Cmd = Cmd.drop_front(); + if (!Cmd.empty()) { + llvm::SmallString<261> path; + llvm::sys::path::native(Twine{Cmd.front()}, path); + if (llvm::sys::path::filename(path).starts_with("swift-frontend")) + Cmd = Cmd.drop_front(); + } // Quote all the arguments before passing to scanner. The scanner is currently // tokenize the command-line again before parsing. From ab1893e6b207940287732559c2a999a507b3427c Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 11 Dec 2025 18:01:15 -0800 Subject: [PATCH 7/7] test: adjust test for more string matching flexibility Use `FileCheck` for the test validation instead of `diff`. This allows us to match the different file system arc separator on Windows which is different across the CAS, where everything is normalised, and the uncached path where we get mixed paths. --- test/CAS/cached_diagnostics_macro.swift | 37 +++++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/test/CAS/cached_diagnostics_macro.swift b/test/CAS/cached_diagnostics_macro.swift index 866d1967fcef4..bceb364b69439 100644 --- a/test/CAS/cached_diagnostics_macro.swift +++ b/test/CAS/cached_diagnostics_macro.swift @@ -4,10 +4,6 @@ // RUN: split-file %s %t // RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %t/macro.swift -// RUN: %target-swift-frontend -typecheck -module-load-mode prefer-serialized -module-name MyApp -module-cache-path %t/clang-module-cache -O \ -// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ -// RUN: %t/main.swift -swift-version 5 -external-plugin-path %t#%swift-plugin-server 2> %t/diag1.txt - // RUN: %target-swift-frontend -scan-dependencies -module-load-mode prefer-serialized -module-name MyApp -module-cache-path %t/clang-module-cache -O \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ // RUN: %t/main.swift -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas -external-plugin-path %t#%swift-plugin-server @@ -24,9 +20,38 @@ // RUN: -swift-version 5 -module-name MyApp -O \ // RUN: -external-plugin-path %t#%swift-plugin-server \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ -// RUN: %t/main.swift @%t/MyApp.cmd -serialize-diagnostics-path %t/Test.diag 2> %t/diag2.txt +// RUN: %t/main.swift @%t/MyApp.cmd -serialize-diagnostics-path %t/Test.diag 2>&1 | %FileCheck -check-prefix CHECK-DIAG %s + +// CHECK-DIAG: macro expansion #myWarning:1:1: warning: 'testDeprecated()' is deprecated [#DeprecatedDeclaration] +// CHECK-DIAG-NEXT: `- TMP_DIR{{/|\\}}main.swift:8:36: note: expanded code originates here +// CHECK-DIAG-NEXT: 6 | +// CHECK-DIAG-NEXT: 7 | func testDiscardableStringify(x: Int) { +// CHECK-DIAG-NEXT: 8 | #toMyWarning("this is a warning") +// CHECK-DIAG-NEXT: | `- note: in expansion of macro 'toMyWarning' here +// CHECK-DIAG-NEXT: +--- macro expansion #toMyWarning ----------------------------------- +// CHECK-DIAG-NEXT: |1 | #myWarning("") +// CHECK-DIAG-NEXT: | | `- note: in expansion of macro 'myWarning' here +// CHECK-DIAG-NEXT: | +--- macro expansion #myWarning ---------------------------------- +// CHECK-DIAG-NEXT: | |1 | testDeprecated() +// CHECK-DIAG-NEXT: | | | `- warning: 'testDeprecated()' is deprecated [#DeprecatedDeclaration] +// CHECK-DIAG-NEXT: | +----------------------------------------------------------------- +// CHECK-DIAG-NEXT: +-------------------------------------------------------------------- +// CHECK-DIAG-NEXT: 9 | #myWarning("this is a warning") +// CHECK-DIAG-NEXT: 10 | } -// RUN: diff %t/diag1.txt %t/diag2.txt +// CHECK-DIAG: macro expansion #myWarning:1:1: warning: 'testDeprecated()' is deprecated [#DeprecatedDeclaration] +// CHECK-DIAG-NEXT: `- TMP_DIR{{/|\\}}main.swift:9:34: note: expanded code originates here +// CHECK-DIAG-NEXT: 7 | func testDiscardableStringify(x: Int) { +// CHECK-DIAG-NEXT: 8 | #toMyWarning("this is a warning") +// CHECK-DIAG-NEXT: 9 | #myWarning("this is a warning") +// CHECK-DIAG-NEXT: | `- note: in expansion of macro 'myWarning' here +// CHECK-DIAG-NEXT: +--- macro expansion #myWarning ------------------------------------- +// CHECK-DIAG-NEXT: |1 | testDeprecated() +// CHECK-DIAG-NEXT: | | `- warning: 'testDeprecated()' is deprecated [#DeprecatedDeclaration] +// CHECK-DIAG-NEXT: +-------------------------------------------------------------------- +// CHECK-DIAG-NEXT: 10 | } +// CHECK-DIAG-NEXT: 11 | +// CHECK-DIAG: [#DeprecatedDeclaration]: //--- macro.swift import SwiftDiagnostics