Skip to content

Commit 8ba6a2c

Browse files
authored
Merge pull request #76640 from hamishknight/driver-parity
[test] Update tests for parity with the new driver
2 parents 9a8f8d0 + 8e0407b commit 8ba6a2c

24 files changed

+43
-87
lines changed

test/ClangImporter/pch-bridging-header-unittest-ok.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: objc_interop
22
// RUN: %empty-directory(%t)
33
// RUN: mkdir -p %t/tmp
4-
// RUN: %target-swiftc_driver -emit-module -import-objc-header %S/Inputs/app-bridging-header-to-pch.h -module-name App -emit-module-path %t/App.swiftmodule %S/Inputs/app-that-uses-pch-bridging-header.swift
4+
// RUN: %target-swiftc_driver -emit-module -disable-bridging-pch -import-objc-header %S/Inputs/app-bridging-header-to-pch.h -module-name App -emit-module-path %t/App.swiftmodule %S/Inputs/app-that-uses-pch-bridging-header.swift
55
// RUN: llvm-bcanalyzer -dump %t/App.swiftmodule | %FileCheck %s
66
// CHECK: IMPORTED_HEADER{{.*}}Inputs/app-bridging-header-to-pch.h
77

test/ClangImporter/pch-bridging-header-unittest-warn.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: objc_interop
22
// RUN: %empty-directory(%t)
33
// RUN: mkdir -p %t/tmp
4-
// RUN: %target-swiftc_driver -emit-module -import-objc-header %S/Inputs/app-bridging-header-to-pch.h -module-name App -emit-module-path %t/App.swiftmodule %S/Inputs/app-that-uses-pch-bridging-header.swift
4+
// RUN: %target-swiftc_driver -emit-module -disable-bridging-pch -import-objc-header %S/Inputs/app-bridging-header-to-pch.h -module-name App -emit-module-path %t/App.swiftmodule %S/Inputs/app-that-uses-pch-bridging-header.swift
55
// RUN: llvm-bcanalyzer -dump %t/App.swiftmodule | %FileCheck %s
66
// CHECK: IMPORTED_HEADER{{.*}}Inputs/app-bridging-header-to-pch.h
77

test/ClangImporter/pch-bridging-header-with-another-bridging-header.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift -emit-module -import-objc-header %S/Inputs/pch-bridging-header-with-another-bridging-header/app.h -I %S/Inputs/pch-bridging-header-with-another-bridging-header -module-name App -emit-module-path %t/App.swiftmodule %S/../Inputs/empty.swift
2+
// RUN: %target-build-swift -emit-module -disable-bridging-pch -import-objc-header %S/Inputs/pch-bridging-header-with-another-bridging-header/app.h -I %S/Inputs/pch-bridging-header-with-another-bridging-header -module-name App -emit-module-path %t/App.swiftmodule %S/../Inputs/empty.swift
33
// RUN: llvm-bcanalyzer -dump %t/App.swiftmodule | %FileCheck %s
44

55
// CHECK: IMPORTED_HEADER{{.*}}Inputs/pch-bridging-header-with-another-bridging-header/app.h
@@ -18,4 +18,4 @@
1818

1919
import App
2020

21-
_ = app_function(2)
21+
_ = app_function(2)

test/ClangImporter/pch-bridging-header.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
// RUN: %target-typecheck-verify-swift -import-objc-header %t/sdk-bridging-header.pch
88

99
// Now test the driver-automated version is inert when disabled
10-
// RUN: env TMPDIR=%t/tmp/ %target-swiftc_driver -typecheck -disable-bridging-pch -save-temps %s -import-objc-header %S/Inputs/sdk-bridging-header.h
10+
// Output path of the PCH differs in the new driver, so force SWIFT_USE_OLD_DRIVER for now.
11+
// 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
1112
// RUN: not ls %t/tmp/*.pch >/dev/null 2>&1
1213

1314
// Test the driver-automated version works by default
14-
// RUN: env TMPDIR=%t/tmp/ %target-swiftc_driver -typecheck -save-temps %s -import-objc-header %S/Inputs/sdk-bridging-header.h
15+
// Output path of the PCH differs in the new driver, so force SWIFT_USE_OLD_DRIVER for now.
16+
// 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
1517
// RUN: ls %t/tmp/*.pch >/dev/null 2>&1
1618
// RUN: llvm-objdump --raw-clang-ast %t/tmp/*.pch | llvm-bcanalyzer -dump | %FileCheck %s
1719
// CHECK: ORIGINAL_FILE{{.*}}Inputs/sdk-bridging-header.h

test/DebugInfo/ASTSection_ObjC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %empty-directory(%t)
55

66
// RUN: cp %S/Inputs/serialized-objc-header.h %t
7-
// RUN: %target-build-swift -emit-executable %S/ASTSection.swift -g -o %t/ASTSection-with-ObjC -import-objc-header %t/serialized-objc-header.h -DOBJC -module-name ASTSection -emit-module
7+
// RUN: %target-build-swift -disable-bridging-pch -emit-executable %S/ASTSection.swift -g -o %t/ASTSection-with-ObjC -import-objc-header %t/serialized-objc-header.h -DOBJC -module-name ASTSection -emit-module
88
// RUN: %lldb-moduleimport-test -verbose %t/ASTSection-with-ObjC | %FileCheck %s
99

1010
// RUN: rm %t/serialized-objc-header.h

test/DebugInfo/file_compilation_dir.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
// RUN: mkdir -p %t
77
// RUN: cd %t
88
// RUN: cp %s .
9-
// RUN: %target-swiftc_driver -g \
9+
// Output paths differ in the new driver, so force SWIFT_USE_OLD_DRIVER for now.
10+
// RUN: env SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -g \
1011
// RUN: -c -file-compilation-dir /path/to \
1112
// RUN: file_compilation_dir.swift -o - -emit-ir | %FileCheck --check-prefix=CHECK-REL %s
12-
// RUN: %target-swiftc_driver -g \
13+
// RUN: env SWIFT_USE_OLD_DRIVER=1 %target-swiftc_driver -g \
1314
// RUN: -c -file-compilation-dir . \
1415
// RUN: file_compilation_dir.swift -o - -emit-ir | %FileCheck --check-prefix=CHECK-REL-CWD %s
1516

test/IDE/local_types.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// Tests lookup and mangling of local types
22

3+
// Avoid emitting the module separately since that would skip non-inlinable
4+
// function bodies without types, and we want to print the decls in
5+
// `singleDefaultArgument`.
36
// RUN: %empty-directory(%t)
4-
// RUN: %target-swiftc_driver -v -emit-module -module-name LocalTypes -o %t/LocalTypes.swiftmodule %s
7+
// RUN: %target-swiftc_driver -v -no-emit-module-separately -emit-module -module-name LocalTypes -o %t/LocalTypes.swiftmodule %s
58
// RUN: %target-swift-ide-test -print-local-types -I %t -module-to-print LocalTypes -source-filename %s > %t.dump
69
// RUN: %FileCheck %s < %t.dump
710
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t.dump

test/IDE/merge_local_types.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %empty-directory(%t)
44

55
// Create separate modules and merge them together
6-
// RUN: %target-swiftc_driver -v -emit-module -module-name LocalTypesMerged -o %t/LocalTypesMerged.swiftmodule %s %S/local_types.swift
6+
// RUN: %target-swiftc_driver -v -no-emit-module-separately -emit-module -module-name LocalTypesMerged -o %t/LocalTypesMerged.swiftmodule %s %S/local_types.swift
77

88
// RUN: %target-swift-ide-test -print-local-types -I %t -module-to-print LocalTypesMerged -source-filename %s | %FileCheck %s -allow-deprecated-dag-overlap
99

test/Index/Store/driver-index-with-auxiliary-outputs.swift

Lines changed: 0 additions & 35 deletions
This file was deleted.

test/Misc/stats_dir_failure_count.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Check that a failed process-tree emits nonzero failure counters
22
// RUN: %empty-directory(%t)
33
// RUN: echo zzz >%t/other.swift
4-
// RUN: not %target-swiftc_driver -continue-building-after-errors -D BROKEN -j 2 -typecheck -stats-output-dir %t %s %t/other.swift
4+
// 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
55
// RUN: %{python} %utils/process-stats-dir.py --set-csv-baseline %t/stats.csv %t
66
// RUN: %FileCheck -input-file %t/stats.csv -check-prefix=FAILURE %s
77
// FAILURE: {{"Driver.NumProcessFailures" 1$}}

0 commit comments

Comments
 (0)