mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 11:35:51 -04:00

OptTable treats arguments starting with / that aren't a known option as filenames. This means lld-link's and clang-cl's typo correction for unknown flags didn't do spell checking for misspelled options that start with /. I first tried changing OptTable, but that got pretty messy, see PR41787 comments 2 and 3. Instead, let lld-link's and clang's (including clang-cl's) "file not found" diagnostic check if a non-existent file looks like it could be a mis-spelled option, and if so add a "did you mean" suggestion to the "file not found" diagnostic. While here, make formatting of a few diagnostics a bit more self-consistent. Fixes PR41787. Differential Revision: https://reviews.llvm.org/D62276 llvm-svn: 361518
8 lines
286 B
C
8 lines
286 B
C
// RUN: not %clang %s --hedonism -### 2>&1 | \
|
|
// RUN: FileCheck %s
|
|
// RUN: not %clang %s --hell -### 2>&1 | \
|
|
// RUN: FileCheck %s --check-prefix=DID-YOU-MEAN
|
|
|
|
// CHECK: error: unsupported option '--hedonism'
|
|
// DID-YOU-MEAN: error: unsupported option '--hell'; did you mean '--help'?
|