xref: /minix3/external/bsd/llvm/dist/clang/test/Driver/clang_f_opts.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // REQUIRES: clang-driver
2*0a6a1f1dSLionel Sambuc 
3f4a2713aSLionel Sambuc // RUN: %clang -### -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fsplit-stack %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
4f4a2713aSLionel Sambuc // RUN: %clang -### -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-asm -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-enums -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
5f4a2713aSLionel Sambuc 
6f4a2713aSLionel Sambuc // CHECK-OPTIONS1: -split-stacks
7f4a2713aSLionel Sambuc // CHECK-OPTIONS1: -fgnu-keywords
8f4a2713aSLionel Sambuc // CHECK-OPTIONS1: -fblocks
9f4a2713aSLionel Sambuc // CHECK-OPTIONS1: -fpascal-strings
10f4a2713aSLionel Sambuc 
11f4a2713aSLionel Sambuc // CHECK-OPTIONS2: -fmath-errno
12*0a6a1f1dSLionel Sambuc // CHECK-OPTIONS2: -fno-gnu-keywords
13f4a2713aSLionel Sambuc // CHECK-OPTIONS2: -fno-builtin
14f4a2713aSLionel Sambuc // CHECK-OPTIONS2: -fshort-enums
15f4a2713aSLionel Sambuc // CHECK-OPTIONS2: -fshort-wchar
16f4a2713aSLionel Sambuc // CHECK-OPTIONS2: -fno-common
17f4a2713aSLionel Sambuc // CHECK-OPTIONS2: -fno-show-source-location
18f4a2713aSLionel Sambuc 
19f4a2713aSLionel Sambuc // RUN: %clang -### -S -Wwrite-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s
20f4a2713aSLionel Sambuc // WRITE-STRINGS1: -fconst-strings
21f4a2713aSLionel Sambuc // RUN: %clang -### -S -Wwrite-strings -Wno-write-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s
22f4a2713aSLionel Sambuc // WRITE-STRINGS2-NOT: -fconst-strings
23*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS3 %s
24*0a6a1f1dSLionel Sambuc // WRITE-STRINGS3-NOT: -fconst-strings
25f4a2713aSLionel Sambuc 
26f4a2713aSLionel Sambuc // RUN: %clang -### -x c++ -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
27f4a2713aSLionel Sambuc // RUN: %clang -### -x c++ -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
28f4a2713aSLionel Sambuc // RUN: %clang -### -x c++ -c -Wno-deprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s
29f4a2713aSLionel Sambuc // RUN: %clang -### -x c++ -c -Wno-deprecated -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
30f4a2713aSLionel Sambuc // RUN: %clang -### -x c++ -c -w %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
31f4a2713aSLionel Sambuc // RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s
32f4a2713aSLionel Sambuc // RUN: %clang -### -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s
33f4a2713aSLionel Sambuc // DEPRECATED-ON-CHECK: -fdeprecated-macro
34f4a2713aSLionel Sambuc // DEPRECATED-OFF-CHECK-NOT: -fdeprecated-macro
35f4a2713aSLionel Sambuc 
36f4a2713aSLionel Sambuc // RUN: %clang -### -S -ffp-contract=fast %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s
37f4a2713aSLionel Sambuc // RUN: %clang -### -S -ffast-math %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s
38f4a2713aSLionel Sambuc // RUN: %clang -### -S -ffp-contract=off %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-OFF-CHECK %s
39f4a2713aSLionel Sambuc // FP-CONTRACT-FAST-CHECK: -ffp-contract=fast
40f4a2713aSLionel Sambuc // FP-CONTRACT-OFF-CHECK: -ffp-contract=off
41f4a2713aSLionel Sambuc 
42f4a2713aSLionel Sambuc // RUN: %clang -### -S -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s
43f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s
44f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-unroll-loops -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s
45f4a2713aSLionel Sambuc // RUN: %clang -### -S -funroll-loops -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s
46f4a2713aSLionel Sambuc // CHECK-UNROLL-LOOPS: "-funroll-loops"
47f4a2713aSLionel Sambuc // CHECK-NO-UNROLL-LOOPS: "-fno-unroll-loops"
48f4a2713aSLionel Sambuc 
49f4a2713aSLionel Sambuc // RUN: %clang -### -S -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s
50f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s
51f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-reroll-loops -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s
52f4a2713aSLionel Sambuc // RUN: %clang -### -S -freroll-loops -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s
53f4a2713aSLionel Sambuc // CHECK-REROLL-LOOPS: "-freroll-loops"
54f4a2713aSLionel Sambuc // CHECK-NO-REROLL-LOOPS-NOT: "-freroll-loops"
55f4a2713aSLionel Sambuc 
56f4a2713aSLionel Sambuc // RUN: %clang -### -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s
57f4a2713aSLionel Sambuc // CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
58f4a2713aSLionel Sambuc 
59*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s
60*0a6a1f1dSLionel Sambuc // CHECK-AUTO-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
61*0a6a1f1dSLionel Sambuc 
62*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s
63*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -fno-profile-arcs -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s
64*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s
65*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s
66*0a6a1f1dSLionel Sambuc // CHECK-PROFILE-ARCS: "-femit-coverage-data"
67*0a6a1f1dSLionel Sambuc // CHECK-NO-PROFILE-ARCS-NOT: "-femit-coverage-data"
68*0a6a1f1dSLionel Sambuc 
69f4a2713aSLionel Sambuc // RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
70f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
71f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
72f4a2713aSLionel Sambuc // RUN: %clang -### -S -fvectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
73f4a2713aSLionel Sambuc // RUN: %clang -### -S -ftree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
74f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-tree-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
75f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-tree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
76f4a2713aSLionel Sambuc // RUN: %clang -### -S -ftree-vectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
77f4a2713aSLionel Sambuc // RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
78f4a2713aSLionel Sambuc // RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
79f4a2713aSLionel Sambuc // RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
80f4a2713aSLionel Sambuc // RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
81f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
82f4a2713aSLionel Sambuc // RUN: %clang -### -S -O1 -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
83f4a2713aSLionel Sambuc // RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
84f4a2713aSLionel Sambuc // RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
85f4a2713aSLionel Sambuc // RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
86f4a2713aSLionel Sambuc // RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
87f4a2713aSLionel Sambuc // RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
88f4a2713aSLionel Sambuc // CHECK-VECTORIZE: "-vectorize-loops"
89f4a2713aSLionel Sambuc // CHECK-NO-VECTORIZE-NOT: "-vectorize-loops"
90f4a2713aSLionel Sambuc 
91f4a2713aSLionel Sambuc // RUN: %clang -### -S -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
92f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
93f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
94f4a2713aSLionel Sambuc // RUN: %clang -### -S -fslp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
95f4a2713aSLionel Sambuc // RUN: %clang -### -S -ftree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
96f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-tree-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
97f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-tree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
98f4a2713aSLionel Sambuc // RUN: %clang -### -S -ftree-slp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
99*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
100*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
101*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
102*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
103*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
104*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -fno-slp-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
105*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -O1 -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
106*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
107*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
108*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
109*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
110f4a2713aSLionel Sambuc // CHECK-SLP-VECTORIZE: "-vectorize-slp"
111f4a2713aSLionel Sambuc // CHECK-NO-SLP-VECTORIZE-NOT: "-vectorize-slp"
112f4a2713aSLionel Sambuc 
113f4a2713aSLionel Sambuc // RUN: %clang -### -S -fslp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE-AGG %s
114f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-slp-vectorize-aggressive -fslp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE-AGG %s
115f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-slp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE-AGG %s
116f4a2713aSLionel Sambuc // RUN: %clang -### -S -fslp-vectorize-aggressive -fno-slp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE-AGG %s
117f4a2713aSLionel Sambuc // CHECK-SLP-VECTORIZE-AGG: "-vectorize-slp-aggressive"
118f4a2713aSLionel Sambuc // CHECK-NO-SLP-VECTORIZE-AGG-NOT: "-vectorize-slp-aggressive"
119f4a2713aSLionel Sambuc 
120f4a2713aSLionel Sambuc // RUN: %clang -### -S -fextended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-EXTENDED-IDENTIFIERS %s
121f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-extended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-NO-EXTENDED-IDENTIFIERS %s
122f4a2713aSLionel Sambuc // CHECK-EXTENDED-IDENTIFIERS: "-cc1"
123f4a2713aSLionel Sambuc // CHECK-EXTENDED-IDENTIFIERS-NOT: "-fextended-identifiers"
124f4a2713aSLionel Sambuc // CHECK-NO-EXTENDED-IDENTIFIERS: error: unsupported option '-fno-extended-identifiers'
125f4a2713aSLionel Sambuc 
126f4a2713aSLionel Sambuc // RUN: %clang -### -S -fno-pascal-strings -mpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-M-PASCAL-STRINGS %s
127f4a2713aSLionel Sambuc // CHECK-M-PASCAL-STRINGS: "-fpascal-strings"
128f4a2713aSLionel Sambuc 
129f4a2713aSLionel Sambuc // RUN: %clang -### -S -fpascal-strings -mno-pascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-NO-M-PASCAL-STRINGS %s
130f4a2713aSLionel Sambuc // CHECK-NO-M-PASCAL-STRINGS-NOT: "-fpascal-strings"
131f4a2713aSLionel Sambuc 
132f4a2713aSLionel Sambuc // RUN: %clang -### -S -O4 %s 2>&1 | FileCheck -check-prefix=CHECK-MAX-O %s
133f4a2713aSLionel Sambuc // CHECK-MAX-O: warning: -O4 is equivalent to -O3
134f4a2713aSLionel Sambuc // CHECK-MAX-O: -O3
135f4a2713aSLionel Sambuc 
136f4a2713aSLionel Sambuc // RUN: %clang -S -O20 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-O %s
137*0a6a1f1dSLionel Sambuc // CHECK-INVALID-O: warning: optimization level '-O20' is not supported; using '-O3' instead
138*0a6a1f1dSLionel Sambuc 
139*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -finput-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-CHARSET %s
140*0a6a1f1dSLionel Sambuc // CHECK-INVALID-CHARSET: error: invalid value 'iso-8859-1' in '-finput-charset=iso-8859-1'
141*0a6a1f1dSLionel Sambuc 
142*0a6a1f1dSLionel Sambuc // RUN: %clang -### -S -fexec-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-INPUT-CHARSET %s
143*0a6a1f1dSLionel Sambuc // CHECK-INVALID-INPUT-CHARSET: error: invalid value 'iso-8859-1' in '-fexec-charset=iso-8859-1'
144f4a2713aSLionel Sambuc 
145f4a2713aSLionel Sambuc // Test that we don't error on these.
146f4a2713aSLionel Sambuc // RUN: %clang -### -S -Werror                                                \
147f4a2713aSLionel Sambuc // RUN:     -falign-functions -falign-functions=2 -fno-align-functions        \
148f4a2713aSLionel Sambuc // RUN:     -fasynchronous-unwind-tables -fno-asynchronous-unwind-tables      \
149f4a2713aSLionel Sambuc // RUN:     -fbuiltin -fno-builtin                                            \
150f4a2713aSLionel Sambuc // RUN:     -fdiagnostics-show-location=once                                  \
151f4a2713aSLionel Sambuc // RUN:     -ffloat-store -fno-float-store                                    \
152f4a2713aSLionel Sambuc // RUN:     -feliminate-unused-debug-types -fno-eliminate-unused-debug-types  \
153f4a2713aSLionel Sambuc // RUN:     -fgcse -fno-gcse                                                  \
154f4a2713aSLionel Sambuc // RUN:     -fident -fno-ident                                                \
155f4a2713aSLionel Sambuc // RUN:     -fimplicit-templates -fno-implicit-templates                      \
156*0a6a1f1dSLionel Sambuc // RUN:     -finput-charset=UTF-8                                             \
157*0a6a1f1dSLionel Sambuc // RUN:     -fexec-charset=UTF-8                                             \
158f4a2713aSLionel Sambuc // RUN:     -fivopts -fno-ivopts                                              \
159f4a2713aSLionel Sambuc // RUN:     -fnon-call-exceptions -fno-non-call-exceptions                    \
160f4a2713aSLionel Sambuc // RUN:     -fpermissive -fno-permissive                                      \
161*0a6a1f1dSLionel Sambuc // RUN:     -fdefer-pop -fno-defer-pop                                        \
162f4a2713aSLionel Sambuc // RUN:     -fprefetch-loop-arrays -fno-prefetch-loop-arrays                  \
163f4a2713aSLionel Sambuc // RUN:     -fprofile-correction -fno-profile-correction                      \
164f4a2713aSLionel Sambuc // RUN:     -fprofile-dir=bar                                                 \
165f4a2713aSLionel Sambuc // RUN:     -fprofile-use -fprofile-use=zed -fno-profile-use                  \
166f4a2713aSLionel Sambuc // RUN:     -fprofile-values -fno-profile-values                              \
167f4a2713aSLionel Sambuc // RUN:     -frounding-math -fno-rounding-math                                \
168f4a2713aSLionel Sambuc // RUN:     -fsee -fno-see                                                    \
169f4a2713aSLionel Sambuc // RUN:     -ftracer -fno-tracer                                              \
170f4a2713aSLionel Sambuc // RUN:     -funroll-all-loops -fno-unroll-all-loops                          \
171f4a2713aSLionel Sambuc // RUN:     -fuse-ld=gold                                                     \
172f4a2713aSLionel Sambuc // RUN:     -fno-builtin-foobar                                               \
173f4a2713aSLionel Sambuc // RUN:     -fno-builtin-strcat -fno-builtin-strcpy                           \
174f4a2713aSLionel Sambuc // RUN:     -fno-var-tracking                                                 \
175f4a2713aSLionel Sambuc // RUN:     -fno-unsigned-char                                                \
176f4a2713aSLionel Sambuc // RUN:     -fno-signed-char                                                  \
177f4a2713aSLionel Sambuc // RUN:     -fstrength-reduce -fno-strength-reduce                            \
178*0a6a1f1dSLionel Sambuc // RUN:     -finline-limit=1000                                               \
179*0a6a1f1dSLionel Sambuc // RUN:     -finline-limit                                                    \
180*0a6a1f1dSLionel Sambuc // RUN:     -flto=1                                                           \
181*0a6a1f1dSLionel Sambuc // RUN:     -falign-labels                                                    \
182*0a6a1f1dSLionel Sambuc // RUN:     -falign-labels=100                                                \
183*0a6a1f1dSLionel Sambuc // RUN:     -falign-loops                                                     \
184*0a6a1f1dSLionel Sambuc // RUN:     -falign-loops=100                                                 \
185*0a6a1f1dSLionel Sambuc // RUN:     -falign-jumps                                                     \
186*0a6a1f1dSLionel Sambuc // RUN:     -falign-jumps=100                                                 \
187*0a6a1f1dSLionel Sambuc // RUN:     -fexcess-precision=100                                            \
188*0a6a1f1dSLionel Sambuc // RUN:     -fbranch-count-reg                                                \
189*0a6a1f1dSLionel Sambuc // RUN:     -fcaller-saves                                                    \
190*0a6a1f1dSLionel Sambuc // RUN:     -fno-default-inline -fdefault-inline                              \
191*0a6a1f1dSLionel Sambuc // RUN:     -fgcse-after-reload                                               \
192*0a6a1f1dSLionel Sambuc // RUN:     -fgcse-las                                                        \
193*0a6a1f1dSLionel Sambuc // RUN:     -fgcse-sm                                                         \
194*0a6a1f1dSLionel Sambuc // RUN:     -fipa-cp                                                          \
195*0a6a1f1dSLionel Sambuc // RUN:     -finline-functions-called-once                                    \
196*0a6a1f1dSLionel Sambuc // RUN:     -fmodulo-sched                                                    \
197*0a6a1f1dSLionel Sambuc // RUN:     -fmodulo-sched-allow-regmoves                                     \
198*0a6a1f1dSLionel Sambuc // RUN:     -fpeel-loops                                                      \
199*0a6a1f1dSLionel Sambuc // RUN:     -frename-registers                                                \
200*0a6a1f1dSLionel Sambuc // RUN:     -fschedule-insns2                                                 \
201*0a6a1f1dSLionel Sambuc // RUN:     -fsingle-precision-constant                                       \
202*0a6a1f1dSLionel Sambuc // RUN:     -ftree_loop_im                                                    \
203*0a6a1f1dSLionel Sambuc // RUN:     -ftree_loop_ivcanon                                               \
204*0a6a1f1dSLionel Sambuc // RUN:     -ftree_loop_linear                                                \
205*0a6a1f1dSLionel Sambuc // RUN:     -funsafe-loop-optimizations                                       \
206*0a6a1f1dSLionel Sambuc // RUN:     -fuse-linker-plugin                                               \
207*0a6a1f1dSLionel Sambuc // RUN:     -fvect-cost-model                                                 \
208*0a6a1f1dSLionel Sambuc // RUN:     -fvariable-expansion-in-unroller                                  \
209*0a6a1f1dSLionel Sambuc // RUN:     -fweb                                                             \
210*0a6a1f1dSLionel Sambuc // RUN:     -fwhole-program                                                   \
211*0a6a1f1dSLionel Sambuc // RUN:     -fno-tree-dce -ftree-dce                                          \
212*0a6a1f1dSLionel Sambuc // RUN:     -fno-tree-ter -ftree-ter                                          \
213*0a6a1f1dSLionel Sambuc // RUN:     -fno-tree-vrp -ftree-vrp                                          \
214*0a6a1f1dSLionel Sambuc // RUN:     -fno-delete-null-pointer-checks -fdelete-null-pointer-checks      \
215*0a6a1f1dSLionel Sambuc // RUN:     -fno-inline-small-functions -finline-small-functions              \
216*0a6a1f1dSLionel Sambuc // RUN:     -fno-fat-lto-objects -ffat-lto-objects                            \
217*0a6a1f1dSLionel Sambuc // RUN:     -fno-merge-constants -fmerge-constants                            \
218*0a6a1f1dSLionel Sambuc // RUN:     -fno-caller-saves -fcaller-saves                                  \
219*0a6a1f1dSLionel Sambuc // RUN:     -fno-reorder-blocks -freorder-blocks                              \
220*0a6a1f1dSLionel Sambuc // RUN:     -fno-schedule-insns2 -fschedule-insns2                            \
221*0a6a1f1dSLionel Sambuc // RUN:     -fno-stack-check                                                  \
222*0a6a1f1dSLionel Sambuc // RUN:     -fno-check-new -fcheck-new                                        \
223*0a6a1f1dSLionel Sambuc // RUN:     -ffriend-injection                                                \
224*0a6a1f1dSLionel Sambuc // RUN:     -fno-implement-inlines -fimplement-inlines                        \
225*0a6a1f1dSLionel Sambuc // RUN:     -fstack-check                                                     \
226*0a6a1f1dSLionel Sambuc // RUN:     -fforce-addr                                                      \
227*0a6a1f1dSLionel Sambuc // RUN:     -malign-functions=100                                             \
228*0a6a1f1dSLionel Sambuc // RUN:     -malign-loops=100                                                 \
229*0a6a1f1dSLionel Sambuc // RUN:     -malign-jumps=100                                                 \
230f4a2713aSLionel Sambuc // RUN:     %s 2>&1 | FileCheck --check-prefix=IGNORE %s
231f4a2713aSLionel Sambuc // IGNORE-NOT: error: unknown argument
232*0a6a1f1dSLionel Sambuc 
233*0a6a1f1dSLionel Sambuc // Test that the warning is displayed on these.
234*0a6a1f1dSLionel Sambuc // RUN: %clang -###                                                           \
235*0a6a1f1dSLionel Sambuc // RUN: -finline-limit=1000                                                   \
236*0a6a1f1dSLionel Sambuc // RUN: -finline-limit                                                        \
237*0a6a1f1dSLionel Sambuc // RUN: -fexpensive-optimizations                                             \
238*0a6a1f1dSLionel Sambuc // RUN: -fno-expensive-optimizations                                          \
239*0a6a1f1dSLionel Sambuc // RUN: -fno-defer-pop                                                        \
240*0a6a1f1dSLionel Sambuc // RUN: -finline-functions                                                    \
241*0a6a1f1dSLionel Sambuc // RUN: -fkeep-inline-functions                                               \
242*0a6a1f1dSLionel Sambuc // RUN: -fno-keep-inline-functions                                            \
243*0a6a1f1dSLionel Sambuc // RUN: -freorder-blocks                                                      \
244*0a6a1f1dSLionel Sambuc // RUN: -fprofile-dir=/rand/dir                                               \
245*0a6a1f1dSLionel Sambuc // RUN: -fprofile-use                                                         \
246*0a6a1f1dSLionel Sambuc // RUN: -fprofile-use=/rand/dir                                               \
247*0a6a1f1dSLionel Sambuc // RUN: -falign-functions                                                     \
248*0a6a1f1dSLionel Sambuc // RUN: -falign-functions=1                                                   \
249*0a6a1f1dSLionel Sambuc // RUN: -ffloat-store                                                         \
250*0a6a1f1dSLionel Sambuc // RUN: -fgcse                                                                \
251*0a6a1f1dSLionel Sambuc // RUN: -fivopts                                                              \
252*0a6a1f1dSLionel Sambuc // RUN: -fprefetch-loop-arrays                                                \
253*0a6a1f1dSLionel Sambuc // RUN: -fprofile-correction                                                  \
254*0a6a1f1dSLionel Sambuc // RUN: -fprofile-values                                                      \
255*0a6a1f1dSLionel Sambuc // RUN: -frounding-math                                                       \
256*0a6a1f1dSLionel Sambuc // RUN: -fschedule-insns                                                      \
257*0a6a1f1dSLionel Sambuc // RUN: -fsignaling-nans                                                      \
258*0a6a1f1dSLionel Sambuc // RUN: -fstrength-reduce                                                     \
259*0a6a1f1dSLionel Sambuc // RUN: -ftracer                                                              \
260*0a6a1f1dSLionel Sambuc // RUN: -funroll-all-loops                                                    \
261*0a6a1f1dSLionel Sambuc // RUN: -funswitch-loops                                                      \
262*0a6a1f1dSLionel Sambuc // RUN: -flto=1                                                               \
263*0a6a1f1dSLionel Sambuc // RUN: -falign-labels                                                        \
264*0a6a1f1dSLionel Sambuc // RUN: -falign-labels=100                                                    \
265*0a6a1f1dSLionel Sambuc // RUN: -falign-loops                                                         \
266*0a6a1f1dSLionel Sambuc // RUN: -falign-loops=100                                                     \
267*0a6a1f1dSLionel Sambuc // RUN: -falign-jumps                                                         \
268*0a6a1f1dSLionel Sambuc // RUN: -falign-jumps=100                                                     \
269*0a6a1f1dSLionel Sambuc // RUN: -fexcess-precision=100                                                \
270*0a6a1f1dSLionel Sambuc // RUN: -fbranch-count-reg                                                    \
271*0a6a1f1dSLionel Sambuc // RUN: -fcaller-saves                                                        \
272*0a6a1f1dSLionel Sambuc // RUN: -fno-default-inline                                                   \
273*0a6a1f1dSLionel Sambuc // RUN: -fgcse-after-reload                                                   \
274*0a6a1f1dSLionel Sambuc // RUN: -fgcse-las                                                            \
275*0a6a1f1dSLionel Sambuc // RUN: -fgcse-sm                                                             \
276*0a6a1f1dSLionel Sambuc // RUN: -fipa-cp                                                              \
277*0a6a1f1dSLionel Sambuc // RUN: -finline-functions-called-once                                        \
278*0a6a1f1dSLionel Sambuc // RUN: -fmodulo-sched                                                        \
279*0a6a1f1dSLionel Sambuc // RUN: -fmodulo-sched-allow-regmoves                                         \
280*0a6a1f1dSLionel Sambuc // RUN: -fpeel-loops                                                          \
281*0a6a1f1dSLionel Sambuc // RUN: -frename-registers                                                    \
282*0a6a1f1dSLionel Sambuc // RUN: -fschedule-insns2                                                     \
283*0a6a1f1dSLionel Sambuc // RUN: -fsingle-precision-constant                                           \
284*0a6a1f1dSLionel Sambuc // RUN: -ftree_loop_im                                                        \
285*0a6a1f1dSLionel Sambuc // RUN: -ftree_loop_ivcanon                                                   \
286*0a6a1f1dSLionel Sambuc // RUN: -ftree_loop_linear                                                    \
287*0a6a1f1dSLionel Sambuc // RUN: -funsafe-loop-optimizations                                           \
288*0a6a1f1dSLionel Sambuc // RUN: -fuse-linker-plugin                                                   \
289*0a6a1f1dSLionel Sambuc // RUN: -fvect-cost-model                                                     \
290*0a6a1f1dSLionel Sambuc // RUN: -fvariable-expansion-in-unroller                                      \
291*0a6a1f1dSLionel Sambuc // RUN: -fweb                                                                 \
292*0a6a1f1dSLionel Sambuc // RUN: -fwhole-program                                                       \
293*0a6a1f1dSLionel Sambuc // RUN: -fcaller-saves                                                        \
294*0a6a1f1dSLionel Sambuc // RUN: -freorder-blocks                                                      \
295*0a6a1f1dSLionel Sambuc // RUN: -fdelete-null-pointer-checks                                          \
296*0a6a1f1dSLionel Sambuc // RUN: -ffat-lto-objects                                                     \
297*0a6a1f1dSLionel Sambuc // RUN: -fmerge-constants                                                     \
298*0a6a1f1dSLionel Sambuc // RUN: -finline-small-functions                                              \
299*0a6a1f1dSLionel Sambuc // RUN: -ftree-dce                                                            \
300*0a6a1f1dSLionel Sambuc // RUN: -ftree-ter                                                            \
301*0a6a1f1dSLionel Sambuc // RUN: -ftree-vrp                                                            \
302*0a6a1f1dSLionel Sambuc // RUN: -fno-devirtualize                                                     \
303*0a6a1f1dSLionel Sambuc // RUN: -fno-devirtualize-speculatively                                       \
304*0a6a1f1dSLionel Sambuc // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s
305*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-finline-limit=1000' is not supported
306*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-finline-limit' is not supported
307*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fexpensive-optimizations' is not supported
308*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fno-expensive-optimizations' is not supported
309*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fno-defer-pop' is not supported
310*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-finline-functions' is not supported
311*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fkeep-inline-functions' is not supported
312*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fno-keep-inline-functions' is not supported
313*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported
314*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fprofile-dir=/rand/dir' is not supported
315*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fprofile-use' is not supported
316*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fprofile-use=/rand/dir' is not supported
317*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-falign-functions' is not supported
318*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-falign-functions=1' is not supported
319*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-ffloat-store' is not supported
320*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fgcse' is not supported
321*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fivopts' is not supported
322*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fprefetch-loop-arrays' is not supported
323*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fprofile-correction' is not supported
324*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fprofile-values' is not supported
325*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-frounding-math' is not supported
326*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fschedule-insns' is not supported
327*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fsignaling-nans' is not supported
328*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fstrength-reduce' is not supported
329*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-ftracer' is not supported
330*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-funroll-all-loops' is not supported
331*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-funswitch-loops' is not supported
332*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-flto=1' is not supported
333*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-falign-labels' is not supported
334*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-falign-labels=100' is not supported
335*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-falign-loops' is not supported
336*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-falign-loops=100' is not supported
337*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-falign-jumps' is not supported
338*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-falign-jumps=100' is not supported
339*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fexcess-precision=100' is not supported
340*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fbranch-count-reg' is not supported
341*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fcaller-saves' is not supported
342*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fno-default-inline' is not supported
343*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fgcse-after-reload' is not supported
344*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fgcse-las' is not supported
345*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fgcse-sm' is not supported
346*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fipa-cp' is not supported
347*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-finline-functions-called-once' is not supported
348*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fmodulo-sched' is not supported
349*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fmodulo-sched-allow-regmoves' is not supported
350*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fpeel-loops' is not supported
351*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-frename-registers' is not supported
352*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fschedule-insns2' is not supported
353*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fsingle-precision-constant' is not supported
354*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-ftree_loop_im' is not supported
355*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-ftree_loop_ivcanon' is not supported
356*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-ftree_loop_linear' is not supported
357*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-funsafe-loop-optimizations' is not supported
358*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fuse-linker-plugin' is not supported
359*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fvect-cost-model' is not supported
360*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fvariable-expansion-in-unroller' is not supported
361*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fweb' is not supported
362*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fwhole-program' is not supported
363*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fcaller-saves' is not supported
364*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported
365*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fdelete-null-pointer-checks' is not supported
366*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-ffat-lto-objects' is not supported
367*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fmerge-constants' is not supported
368*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-finline-small-functions' is not supported
369*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-ftree-dce' is not supported
370*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-ftree-ter' is not supported
371*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-ftree-vrp' is not supported
372*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fno-devirtualize' is not supported
373*0a6a1f1dSLionel Sambuc // CHECK-WARNING-DAG: optimization flag '-fno-devirtualize-speculatively' is not supported
374*0a6a1f1dSLionel Sambuc 
375*0a6a1f1dSLionel Sambuc // Test that we mute the warning on these
376*0a6a1f1dSLionel Sambuc // RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument              \
377*0a6a1f1dSLionel Sambuc // RUN:     %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING1 %s
378*0a6a1f1dSLionel Sambuc // RUN: %clang -### -finline-limit -Wno-invalid-command-line-argument                   \
379*0a6a1f1dSLionel Sambuc // RUN:     %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s
380*0a6a1f1dSLionel Sambuc // RUN: %clang -### -finline-limit \
381*0a6a1f1dSLionel Sambuc // RUN:     -Winvalid-command-line-argument -Wno-ignored-optimization-argument          \
382*0a6a1f1dSLionel Sambuc // RUN:     %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s
383*0a6a1f1dSLionel Sambuc // CHECK-NO-WARNING1-NOT: optimization flag '-finline-limit=1000' is not supported
384*0a6a1f1dSLionel Sambuc // CHECK-NO-WARNING2-NOT: optimization flag '-finline-limit' is not supported
385*0a6a1f1dSLionel Sambuc 
386*0a6a1f1dSLionel Sambuc 
387*0a6a1f1dSLionel Sambuc // RUN: %clang -### -fshort-wchar -fno-short-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR1 %s
388*0a6a1f1dSLionel Sambuc // RUN: %clang -### -fno-short-wchar -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR2 %s
389*0a6a1f1dSLionel Sambuc // CHECK-WCHAR1: -fno-short-wchar
390*0a6a1f1dSLionel Sambuc // CHECK-WCHAR1-NOT: -fshort-wchar
391*0a6a1f1dSLionel Sambuc // CHECK-WCHAR2: -fshort-wchar
392*0a6a1f1dSLionel Sambuc // CHECK-WCHAR2-NOT: -fno-short-wchar
393