xref: /minix3/external/bsd/llvm/dist/clang/test/Driver/cl-zc.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1 // Don't attempt slash switches on msys bash.
2 // REQUIRES: shell-preserves-root
3 
4 // Note: %s must be preceded by --, otherwise it may be interpreted as a
5 // command-line option, e.g. on Mac where %s is commonly under /Users.
6 
7 // RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=TRIGRAPHS-DEFAULT %s
8 // cc1 will disable trigraphs for -fms-compatibility as long as -ftrigraphs
9 // isn't explicitly passed.
10 // TRIGRAPHS-DEFAULT-NOT: "-ftrigraphs"
11 
12 // RUN: %clang_cl /c -### /Zc:trigraphs -- %s 2>&1 | FileCheck -check-prefix=TRIGRAPHS-ON %s
13 // TRIGRAPHS-ON: "-ftrigraphs"
14 
15 // RUN: %clang_cl /c -### /Zc:trigraphs- -- %s 2>&1 | FileCheck -check-prefix=TRIGRAPHS-OFF %s
16 // TRIGRAPHS-OFF: "-fno-trigraphs"
17 
18 // RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-DEFAULT %s
19 // STRICTSTRINGS-DEFAULT-NOT: -Werror=c++11-compat-deprecated-writable-strings
20 // RUN: %clang_cl /c -### /Zc:strictStrings -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-ON %s
21 // STRICTSTRINGS-ON: -Werror=c++11-compat-deprecated-writable-strings
22 // RUN: %clang_cl /c -### /Zc:strictStrings- -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-OFF %s
23 // STRICTSTRINGS-OFF: argument unused during compilation
24 
25 
26 // RUN: %clang_cl /c -### /Zc:foobar -- %s 2>&1 | FileCheck -check-prefix=FOOBAR-ON %s
27 // FOOBAR-ON: argument unused during compilation
28 // RUN: %clang_cl /c -### /Zc:foobar- -- %s 2>&1 | FileCheck -check-prefix=FOOBAR-ON %s
29 // FOOBAR-OFF: argument unused during compilation
30 
31 // These are ignored if enabled, and warn if disabled.
32 
33 // RUN: %clang_cl /c -### /Zc:forScope -- %s 2>&1 | FileCheck -check-prefix=FORSCOPE-ON %s
34 // FORSCOPE-ON-NOT: argument unused during compilation
35 // RUN: %clang_cl /c -### /Zc:forScope- -- %s 2>&1 | FileCheck -check-prefix=FORSCOPE-OFF %s
36 // FORSCOPE-OFF: argument unused during compilation
37 
38 // RUN: %clang_cl /c -### /Zc:wchar_t -- %s 2>&1 | FileCheck -check-prefix=WCHAR_T-ON %s
39 // WCHAR_T-ON-NOT: argument unused during compilation
40 // RUN: %clang_cl /c -### /Zc:wchar_t- -- %s 2>&1 | FileCheck -check-prefix=WCHAR_T-OFF %s
41 // WCHAR_T-OFF: argument unused during compilation
42 
43 // RUN: %clang_cl /c -### /Zc:auto -- %s 2>&1 | FileCheck -check-prefix=AUTO-ON %s
44 // AUTO-ON-NOT: argument unused during compilation
45 // RUN: %clang_cl /c -### /Zc:auto- -- %s 2>&1 | FileCheck -check-prefix=AUTO-OFF %s
46 // AUTO-OFF: argument unused during compilation
47 
48 // RUN: %clang_cl /c -### /Zc:inline -- %s 2>&1 | FileCheck -check-prefix=INLINE-ON %s
49 // INLINE-ON-NOT: argument unused during compilation
50 // RUN: %clang_cl /c -### /Zc:inline- -- %s 2>&1 | FileCheck -check-prefix=INLINE-OFF %s
51 // INLINE-OFF: argument unused during compilation
52 
53 
54 // These never warn, but don't have an effect yet.
55 
56 // RUN: %clang_cl /c -### /Zc:rvalueCast -- %s 2>&1 | FileCheck -check-prefix=RVALUECAST-ON %s
57 // RVALUECAST-ON-NOT: argument unused during compilation
58 // RUN: %clang_cl /c -### /Zc:rvalueCast- -- %s 2>&1 | FileCheck -check-prefix=RVALUECAST-OFF %s
59 // RVALUECAST-OFF: argument unused during compilation
60