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