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