Skip to content

Commit 839dfc0

Browse files
committed
[test] Tighten up test/Driver/filelists.swift.
- Stronger CHECK lines. - Don't try to link when there's a fake frontend. - Give the fake 'ld' an explicit .py suffix, and use a symlink to access it, which uncovered the first two problems.
1 parent f61aa7a commit 839dfc0

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

test/Driver/Inputs/filelists/ld renamed to test/Driver/Inputs/filelists/fake-ld.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# ld - Fake Darwin linker to test driver-produced -filelists.
2+
# fake-ld.py - Fake Darwin linker to test driver-produced -filelists.
33
#
44
# This source file is part of the Swift.org open source project
55
#

test/Driver/filelists.swift

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,29 @@
1212

1313
// RUN: %swiftc_driver_plain -driver-use-frontend-path %S/Inputs/filelists/check-filelist-abc.py -c %t/a.swift %t/b.swift %t/c.swift -module-name main -target x86_64-apple-macosx10.9 -driver-use-filelists -force-single-frontend-invocation 2>&1 | FileCheck -check-prefix=CHECK-WMO %s
1414

15-
// CHECK-NOT: Handled
15+
// CHECK-WMO-NOT: Handled
1616
// CHECK-WMO: Handled all
17-
// CHECK-NOT: output
18-
// CHECK-NOT: Handled
17+
// CHECK-WMO-NOT: output
18+
// CHECK-WMO-NOT: Handled
19+
1920

21+
// RUN: mkdir %t/bin
22+
// RUN: ln -s %S/Inputs/filelists/fake-ld.py %t/bin/ld
2023

21-
// RUN: (cd %t && %swiftc_driver_plain -driver-use-frontend-path %S/Inputs/filelists/check-filelist-abc.py -emit-library ./a.swift ./b.swift ./c.swift -module-name main -target x86_64-apple-macosx10.9 -driver-use-filelists -output-file-map=%S/Inputs/filelists/output.json -force-single-frontend-invocation -num-threads 1 2>&1 | FileCheck -check-prefix=CHECK-WMO-THREADED %s)
22-
// RUN: (cd %t && %swiftc_driver_plain -driver-use-frontend-path %S/Inputs/filelists/check-filelist-abc.py -emit-library ./a.swift ./b.swift ./c.swift -module-name main -target x86_64-apple-macosx10.9 -driver-use-filelists -output-file-map=%S/Inputs/filelists/output.json -force-single-frontend-invocation -num-threads 1 -embed-bitcode 2>&1 | FileCheck -check-prefix=CHECK-WMO-THREADED %s)
24+
// RUN: (cd %t && %swiftc_driver_plain -driver-use-frontend-path %S/Inputs/filelists/check-filelist-abc.py -c ./a.swift ./b.swift ./c.swift -module-name main -target x86_64-apple-macosx10.9 -driver-use-filelists -output-file-map=%S/Inputs/filelists/output.json -force-single-frontend-invocation -num-threads 1 2>&1 | FileCheck -check-prefix=CHECK-WMO-THREADED %s)
25+
// RUN: (cd %t && %swiftc_driver_plain -driver-use-frontend-path %S/Inputs/filelists/check-filelist-abc.py -c ./a.swift ./b.swift ./c.swift -module-name main -target x86_64-apple-macosx10.9 -driver-use-filelists -output-file-map=%S/Inputs/filelists/output.json -force-single-frontend-invocation -num-threads 1 -embed-bitcode 2>&1 | FileCheck -check-prefix=CHECK-WMO-THREADED %s)
2326
// RUN: mkdir %t/tmp/
2427
// RUN: (cd %t && env TMPDIR="%t/tmp/" %swiftc_driver_plain -driver-use-frontend-path %S/Inputs/filelists/check-filelist-abc.py -c ./a.swift ./b.swift ./c.swift -module-name main -target x86_64-apple-macosx10.9 -driver-use-filelists -output-file-map=%S/Inputs/filelists/output.json -force-single-frontend-invocation -num-threads 1 -save-temps 2>&1 | FileCheck -check-prefix=CHECK-WMO-THREADED %s)
2528
// RUN: ls %t/tmp/sources-* %t/tmp/outputs-*
2629

27-
// CHECK-NOT: Handled
30+
// CHECK-WMO-THREADED-NOT: Handled
2831
// CHECK-WMO-THREADED: Handled all
2932
// CHECK-WMO-THREADED-NEXT: ...with output!
30-
// CHECK-NOT: Handled
33+
// CHECK-WMO-THREADED-NOT: Handled
34+
3135

32-
// RUN: (cd %t && env PATH=%S/Inputs/filelists/:$PATH %swiftc_driver_plain -driver-use-frontend-path %S/Inputs/filelists/check-filelist-abc.py -emit-library ./a.swift ./b.swift ./c.swift -module-name main -target x86_64-apple-macosx10.9 -driver-use-filelists -output-file-map=%S/Inputs/filelists/output.json 2>&1 | FileCheck -check-prefix=CHECK-LINK %s)
33-
// RUN: (cd %t && env PATH=%S/Inputs/filelists/:$PATH %swiftc_driver_plain -driver-use-frontend-path %S/Inputs/filelists/check-filelist-abc.py -emit-library ./a.swift ./b.swift ./c.swift -module-name main -target x86_64-apple-macosx10.9 -driver-use-filelists -output-file-map=%S/Inputs/filelists/output.json -force-single-frontend-invocation -num-threads 1 2>&1 | FileCheck -check-prefix=CHECK-LINK %s)
36+
// RUN: (cd %t && env PATH=%t/bin/:$PATH %swiftc_driver_plain -driver-use-frontend-path %S/Inputs/filelists/check-filelist-abc.py -emit-library ./a.swift ./b.swift ./c.swift -module-name main -target x86_64-apple-macosx10.9 -driver-use-filelists -output-file-map=%S/Inputs/filelists/output.json 2>&1 | FileCheck -check-prefix=CHECK-LINK %s)
37+
// RUN: (cd %t && env PATH=%t/bin/:$PATH %swiftc_driver_plain -driver-use-frontend-path %S/Inputs/filelists/check-filelist-abc.py -emit-library ./a.swift ./b.swift ./c.swift -module-name main -target x86_64-apple-macosx10.9 -driver-use-filelists -output-file-map=%S/Inputs/filelists/output.json -force-single-frontend-invocation -num-threads 1 2>&1 | FileCheck -check-prefix=CHECK-LINK %s)
3438

3539
// CHECK-LINK: Handled link
3640

0 commit comments

Comments
 (0)