Skip to content

[Driver] Don't test for null source locations in driver diagnostics #33835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/Frontend/unknown-arguments.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// RUN: not %swift -fake-argument -abcdef -c %s -o %t.o 2>&1 | %FileCheck %s

// CHECK: <unknown>:0: error: unknown argument: '-fake-argument'
// CHECK-NEXT: <unknown>:0: error: unknown argument: '-abcdef'
// CHECK: error: unknown argument: '-fake-argument'
// CHECK-NEXT: error: unknown argument: '-abcdef'

// RUN: not %swiftc_driver -c %s -o %t.o -Xfrontend -fake-frontend-arg -Xfrontend fakevalue 2>&1 | %FileCheck -check-prefix=XFRONTEND %s

// XFRONTEND: <unknown>:0: error: unknown argument: '-fake-frontend-arg'
// XFRONTEND: error: unknown argument: '-fake-frontend-arg'

// RUN: not %swiftc_driver -D Correct -DAlsoCorrect -D@#%! -D Swift=Cool -D-D -c %s -o %t.o 2>&1 | %FileCheck -check-prefix=INVALID-COND %s
// INVALID-COND: <unknown>:0: error: conditional compilation flags must be valid Swift identifiers (rather than '@#%!')
// INVALID-COND-NEXT: <unknown>:0: warning: conditional compilation flags do not have values in Swift; they are either present or absent (rather than 'Swift=Cool')
// INVALID-COND-NEXT: <unknown>:0: error: invalid argument '-D-D'; did you provide a redundant '-D' in your build settings?
// INVALID-COND: error: conditional compilation flags must be valid Swift identifiers (rather than '@#%!')
// INVALID-COND-NEXT: warning: conditional compilation flags do not have values in Swift; they are either present or absent (rather than 'Swift=Cool')
// INVALID-COND-NEXT: error: invalid argument '-D-D'; did you provide a redundant '-D' in your build settings?

2 changes: 1 addition & 1 deletion test/Misc/serialized-diagnostics-batch-mode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The `-serialize-diagnostics-path` flag is not allowed for batch mode invoked by swiftc
// RUN: not %target-swiftc_driver -serialize-diagnostics-path %t.notexpected.dia %s %S/Inputs/serialized-diagnostics-batch-mode-helper.swift -c -o %t.o 2>&1 | %FileCheck %s
// CHECK: <unknown>:0: error: option '-serialize-diagnostics-path' is not supported by 'swiftc'; did you mean to use 'swift'?
// CHECK: error: option '-serialize-diagnostics-path' is not supported by 'swiftc'; did you mean to use 'swift'?
// RUN: not ls %t.notexpected.dia > /dev/null
// RUN: not ls %t.o > /dev/null

Expand Down