[test] Add SWIFT_USE_OLD_DRIVER=1 to some tests

The behavior of these tests varies depending on
whether the new or old driver is being used, force
the old driver for now.
This commit is contained in:
Hamish Knight
2024-09-22 23:10:40 +01:00
parent 0d9f667516
commit 8e0407b8c1
6 changed files with 15 additions and 8 deletions

View File

@@ -7,11 +7,13 @@
// RUN: %target-typecheck-verify-swift -import-objc-header %t/sdk-bridging-header.pch // RUN: %target-typecheck-verify-swift -import-objc-header %t/sdk-bridging-header.pch
// Now test the driver-automated version is inert when disabled // Now test the driver-automated version is inert when disabled
// RUN: env TMPDIR=%t/tmp/ %target-swiftc_driver -typecheck -disable-bridging-pch -save-temps %s -import-objc-header %S/Inputs/sdk-bridging-header.h // Output path of the PCH differs in the new driver, so force SWIFT_USE_OLD_DRIVER for now.
// RUN: env TMPDIR=%t/tmp/ SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -typecheck -disable-bridging-pch -save-temps %s -import-objc-header %S/Inputs/sdk-bridging-header.h
// RUN: not ls %t/tmp/*.pch >/dev/null 2>&1 // RUN: not ls %t/tmp/*.pch >/dev/null 2>&1
// Test the driver-automated version works by default // Test the driver-automated version works by default
// RUN: env TMPDIR=%t/tmp/ %target-swiftc_driver -typecheck -save-temps %s -import-objc-header %S/Inputs/sdk-bridging-header.h // Output path of the PCH differs in the new driver, so force SWIFT_USE_OLD_DRIVER for now.
// RUN: env TMPDIR=%t/tmp/ SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -typecheck -save-temps %s -import-objc-header %S/Inputs/sdk-bridging-header.h
// RUN: ls %t/tmp/*.pch >/dev/null 2>&1 // RUN: ls %t/tmp/*.pch >/dev/null 2>&1
// RUN: llvm-objdump --raw-clang-ast %t/tmp/*.pch | llvm-bcanalyzer -dump | %FileCheck %s // RUN: llvm-objdump --raw-clang-ast %t/tmp/*.pch | llvm-bcanalyzer -dump | %FileCheck %s
// CHECK: ORIGINAL_FILE{{.*}}Inputs/sdk-bridging-header.h // CHECK: ORIGINAL_FILE{{.*}}Inputs/sdk-bridging-header.h

View File

@@ -6,10 +6,11 @@
// RUN: mkdir -p %t // RUN: mkdir -p %t
// RUN: cd %t // RUN: cd %t
// RUN: cp %s . // RUN: cp %s .
// RUN: %target-swiftc_driver -g \ // Output paths differ in the new driver, so force SWIFT_USE_OLD_DRIVER for now.
// RUN: env SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -g \
// RUN: -c -file-compilation-dir /path/to \ // RUN: -c -file-compilation-dir /path/to \
// RUN: file_compilation_dir.swift -o - -emit-ir | %FileCheck --check-prefix=CHECK-REL %s // RUN: file_compilation_dir.swift -o - -emit-ir | %FileCheck --check-prefix=CHECK-REL %s
// RUN: %target-swiftc_driver -g \ // RUN: env SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -g \
// RUN: -c -file-compilation-dir . \ // RUN: -c -file-compilation-dir . \
// RUN: file_compilation_dir.swift -o - -emit-ir | %FileCheck --check-prefix=CHECK-REL-CWD %s // RUN: file_compilation_dir.swift -o - -emit-ir | %FileCheck --check-prefix=CHECK-REL-CWD %s

View File

@@ -1,7 +1,7 @@
// Check that a failed process-tree emits nonzero failure counters // Check that a failed process-tree emits nonzero failure counters
// RUN: %empty-directory(%t) // RUN: %empty-directory(%t)
// RUN: echo zzz >%t/other.swift // RUN: echo zzz >%t/other.swift
// RUN: not %target-swiftc_driver -continue-building-after-errors -D BROKEN -j 2 -typecheck -stats-output-dir %t %s %t/other.swift // RUN: not env SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -continue-building-after-errors -D BROKEN -j 2 -typecheck -stats-output-dir %t %s %t/other.swift
// RUN: %{python} %utils/process-stats-dir.py --set-csv-baseline %t/stats.csv %t // RUN: %{python} %utils/process-stats-dir.py --set-csv-baseline %t/stats.csv %t
// RUN: %FileCheck -input-file %t/stats.csv -check-prefix=FAILURE %s // RUN: %FileCheck -input-file %t/stats.csv -check-prefix=FAILURE %s
// FAILURE: {{"Driver.NumProcessFailures" 1$}} // FAILURE: {{"Driver.NumProcessFailures" 1$}}

View File

@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t) // RUN: %empty-directory(%t)
// RUN: touch %t/main.swift // RUN: touch %t/main.swift
// RUN: %target-swiftc_driver -o %t/main -module-name main -stats-output-dir %t %t/main.swift // RUN: env SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -o %t/main -module-name main -stats-output-dir %t %t/main.swift
// RUN: %{python} %utils/process-stats-dir.py --set-csv-baseline %t/frontend.csv %t // RUN: %{python} %utils/process-stats-dir.py --set-csv-baseline %t/frontend.csv %t
// RUN: %FileCheck -input-file %t/frontend.csv %s // RUN: %FileCheck -input-file %t/frontend.csv %s

View File

@@ -51,7 +51,10 @@
// RUN: rm -rf %t/Bar.package.swiftinterface // RUN: rm -rf %t/Bar.package.swiftinterface
/// Print -package-name in public or private interface. /// Print -package-name in public or private interface.
// RUN: %target-build-swift -emit-module %t/Bar.swift -I %t \ /// Note the order of arguments differs across old/new driver, so force old
/// driver for now.
// RUN: env SWIFT_USE_OLD_DRIVER=1 %target-build-swift \
// RUN: -emit-module %t/Bar.swift -I %t \
// RUN: -module-name Bar -package-name barpkg \ // RUN: -module-name Bar -package-name barpkg \
// RUN: -enable-library-evolution -swift-version 6 \ // RUN: -enable-library-evolution -swift-version 6 \
// RUN: -Xfrontend -print-package-name-in-non-package-interface \ // RUN: -Xfrontend -print-package-name-in-non-package-interface \

View File

@@ -4,7 +4,8 @@
// RUN: %empty-directory(%t/Frameworks/has_alias.framework/Modules/has_alias.swiftmodule) // RUN: %empty-directory(%t/Frameworks/has_alias.framework/Modules/has_alias.swiftmodule)
// RUN: %target-swift-frontend -emit-module -o %t/Frameworks/has_alias.framework/Modules/has_alias.swiftmodule/%target-swiftmodule-name %S/Inputs/alias.swift -module-name has_alias // RUN: %target-swift-frontend -emit-module -o %t/Frameworks/has_alias.framework/Modules/has_alias.swiftmodule/%target-swiftmodule-name %S/Inputs/alias.swift -module-name has_alias
// RUN: cd %t/secret && %target-swiftc_driver -emit-module -o %t/has_xref.swiftmodule -I . -F ../Frameworks -parse-as-library %S/Inputs/has_xref.swift %S/../Inputs/empty.swift -Xfrontend -serialize-debugging-options -Xcc -ivfsoverlay -Xcc %S/../Inputs/unextended-module-overlay.yaml -Xcc -DDUMMY // Output paths differ in the new driver, so force SWIFT_USE_OLD_DRIVER for now.
// RUN: cd %t/secret && env SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -emit-module -o %t/has_xref.swiftmodule -I . -F ../Frameworks -parse-as-library %S/Inputs/has_xref.swift %S/../Inputs/empty.swift -Xfrontend -serialize-debugging-options -Xcc -ivfsoverlay -Xcc %S/../Inputs/unextended-module-overlay.yaml -Xcc -DDUMMY
// RUN: %target-swift-frontend %s -typecheck -I %t // RUN: %target-swift-frontend %s -typecheck -I %t
// Ensure that in Swift 6 mode we do not read out search paths, thus are no longer able to // Ensure that in Swift 6 mode we do not read out search paths, thus are no longer able to