1 // RUN: not %clang %s -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -ifoo -imultilib dir -### 2>&1 | \
3 // RUN: %clang %s -imultilib dir -### 2>&1 | \
4 // RUN: FileCheck %s --check-prefix=MULTILIB
5 // RUN: not %clang %s -stdlibs=foo -hell -version -### 2>&1 | \
6 // RUN: FileCheck %s --check-prefix=DID-YOU-MEAN
7 // RUN: %clang_cl -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -### -c -- %s 2>&1 | \
8 // RUN: FileCheck %s --check-prefix=CL
9 // RUN: %clang_cl -Brepo -### -- %s 2>&1 | \
10 // RUN: FileCheck %s --check-prefix=CL-DID-YOU-MEAN
11 // RUN: not %clang_cl /Brepo -### -- %s 2>&1 | \
12 // RUN: FileCheck %s --check-prefix=CL-DID-YOU-MEAN-SLASH
13 // RUN: not %clang_cl /Brepo -### /Tc%s /link 2>&1 | \
14 // RUN: FileCheck %s --check-prefix=CL-DID-YOU-MEAN-SLASH
15 // RUN: not %clang_cl -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -c -Werror=unknown-argument -### -- %s 2>&1 | \
16 // RUN: FileCheck %s --check-prefix=CL-ERROR
17 // RUN: not %clang_cl -helo -Werror=unknown-argument -### -- %s 2>&1 | \
18 // RUN: FileCheck %s --check-prefix=CL-ERROR-DID-YOU-MEAN
19 // RUN: %clang_cl -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -c -Wno-unknown-argument -### -- %s 2>&1 | \
20 // RUN: FileCheck %s --check-prefix=SILENT
21 // RUN: not %clang -cc1as -hell --version 2>&1 | \
22 // RUN: FileCheck %s --check-prefix=CC1AS-DID-YOU-MEAN
23 // RUN: not %clang -cc1asphalt -help 2>&1 | \
24 // RUN: FileCheck %s --check-prefix=UNKNOWN-INTEGRATED
26 // This needs to exit non-0, for configure scripts.
27 // RUN: not %clang /GR-
29 // CHECK: error: unknown argument: '-cake-is-lie'
30 // CHECK: error: unknown argument: '-%0'
31 // CHECK: error: unknown argument: '-%d'
32 // CHECK: error: unknown argument: '-HHHH'
33 // CHECK: error: unknown argument: '-munknown-to-clang-option'
34 // CHECK: error: unknown argument '-print-stats'; did you mean '-Xclang -print-stats'?
35 // CHECK: error: unknown argument: '-funknown-to-clang-option'
36 // CHECK: error: unknown argument: '-ifoo'
37 // MULTILIB: warning: argument unused during compilation: '-imultilib dir'
38 // DID-YOU-MEAN: error: unknown argument '-stdlibs=foo'; did you mean '-stdlib=foo'?
39 // DID-YOU-MEAN: error: unknown argument '-hell'; did you mean '-help'?
40 // DID-YOU-MEAN: error: unknown argument '-version'; did you mean '--version'?
41 // CL: warning: unknown argument ignored in clang-cl: '-cake-is-lie'
42 // CL: warning: unknown argument ignored in clang-cl: '-%0'
43 // CL: warning: unknown argument ignored in clang-cl: '-%d'
44 // CL: warning: unknown argument ignored in clang-cl: '-HHHH'
45 // CL: warning: unknown argument ignored in clang-cl: '-munknown-to-clang-option'
46 // CL: warning: unknown argument ignored in clang-cl: '-print-stats'
47 // CL: warning: unknown argument ignored in clang-cl: '-funknown-to-clang-option'
48 // CL-DID-YOU-MEAN: warning: unknown argument ignored in clang-cl '-Brepo'; did you mean '-Brepro'?
49 // CL-DID-YOU-MEAN-SLASH: error: no such file or directory: '/Brepo'; did you mean '/Brepro'?
50 // CL-ERROR: error: unknown argument ignored in clang-cl: '-cake-is-lie'
51 // CL-ERROR: error: unknown argument ignored in clang-cl: '-%0'
52 // CL-ERROR: error: unknown argument ignored in clang-cl: '-%d'
53 // CL-ERROR: error: unknown argument ignored in clang-cl: '-HHHH'
54 // CL-ERROR: error: unknown argument ignored in clang-cl: '-munknown-to-clang-option'
55 // CL-ERROR: error: unknown argument ignored in clang-cl: '-print-stats'
56 // CL-ERROR: error: unknown argument ignored in clang-cl: '-funknown-to-clang-option'
57 // CL-ERROR-DID-YOU-MEAN: error: unknown argument ignored in clang-cl '-helo'; did you mean '-help'?
59 // SILENT-NOT: warning:
60 // CC1AS-DID-YOU-MEAN: error: unknown argument '-hell'; did you mean '-help'?
61 // CC1AS-DID-YOU-MEAN: error: unknown argument '--version'; did you mean '-version'?
62 // UNKNOWN-INTEGRATED: error: unknown integrated tool '-cc1asphalt'. Valid tools include '-cc1', '-cc1as' and '-cc1gen-reproducer'.
64 // RUN: %clang -S %s -o %t.s -Wunknown-to-clang-option 2>&1 | FileCheck --check-prefix=IGNORED %s
66 // IGNORED: warning: unknown warning option '-Wunknown-to-clang-option'
68 // RUN: %clang -### -offload-arch=sm_70 --offload-arch=sm_70 -offload-device-only -o ffload-device-only \
69 // RUN: -output -o foo %s 2>&1 | FileCheck --check-prefix=O-WARN %s
70 // O-WARN: warning: joined argument treated as '-o ffload-arch=sm_70'; did you mean '--offload-arch=sm_70'?
71 // O-WARN-NEXT: warning: joined argument treated as '-o ffload-device-only'; did you mean '--offload-device-only'?
72 // O-WARN-NEXT: warning: joined argument treated as '-o utput'; did you mean '--output'?