Clang Project

clang_source_code/test/Driver/clang_f_opts.c
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 %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: -fno-common
16// CHECK-OPTIONS2: -fno-show-source-location
17
18// RUN: %clang -### -S -Wwrite-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s
19// WRITE-STRINGS1: -fconst-strings
20// RUN: %clang -### -S -Wwrite-strings -Wno-write-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s
21// WRITE-STRINGS2-NOT: -fconst-strings
22// RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS3 %s
23// WRITE-STRINGS3-NOT: -fconst-strings
24
25// RUN: %clang -### -x c++ -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
26// RUN: %clang -### -x c++ -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
27// RUN: %clang -### -x c++ -c -Wno-deprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s
28// RUN: %clang -### -x c++ -c -Wno-deprecated -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
29// RUN: %clang -### -x c++ -c -w %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
30// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s
31// RUN: %clang -### -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s
32// DEPRECATED-ON-CHECK: -fdeprecated-macro
33// DEPRECATED-OFF-CHECK-NOT: -fdeprecated-macro
34
35// RUN: %clang -### -S -ffp-contract=fast %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s
36// RUN: %clang -### -S -ffast-math %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s
37// RUN: %clang -### -S -ffp-contract=off %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-OFF-CHECK %s
38// FP-CONTRACT-FAST-CHECK: -ffp-contract=fast
39// FP-CONTRACT-OFF-CHECK: -ffp-contract=off
40
41// RUN: %clang -### -S -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s
42// RUN: %clang -### -S -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s
43// RUN: %clang -### -S -fno-unroll-loops -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s
44// RUN: %clang -### -S -funroll-loops -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s
45// CHECK-UNROLL-LOOPS: "-funroll-loops"
46// CHECK-NO-UNROLL-LOOPS: "-fno-unroll-loops"
47
48// RUN: %clang -### -S -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s
49// RUN: %clang -### -S -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s
50// RUN: %clang -### -S -fno-reroll-loops -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s
51// RUN: %clang -### -S -freroll-loops -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s
52// CHECK-REROLL-LOOPS: "-freroll-loops"
53// CHECK-NO-REROLL-LOOPS-NOT: "-freroll-loops"
54
55// RUN: %clang -### -S -fprofile-sample-accurate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-SAMPLE-ACCURATE %s
56// CHECK-PROFILE-SAMPLE-ACCURATE: "-fprofile-sample-accurate"
57
58// RUN: %clang -### -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s
59// CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
60
61// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s
62// CHECK-AUTO-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
63
64// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof -fno-profile-sample-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-AUTO-PROFILE %s
65// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof -fno-auto-profile %s 2>&1 | FileCheck -check-prefix=CHECK-NO-AUTO-PROFILE %s
66// CHECK-NO-AUTO-PROFILE-NOT: "-fprofile-sample-use={{.*}}/file.prof"
67
68// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof -fno-profile-sample-use -fauto-profile %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s
69// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof -fno-auto-profile -fprofile-sample-use %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s
70
71// RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s
72// RUN: %clang -### -S -fno-profile-arcs -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s
73// RUN: %clang -### -S -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s
74// RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s
75// CHECK-PROFILE-ARCS: "-femit-coverage-data"
76// CHECK-NO-PROFILE-ARCS-NOT: "-femit-coverage-data"
77
78// RUN: %clang -### -S -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR-UNUSED %s
79// RUN: %clang -### -S -ftest-coverage -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR-UNUSED %s
80// RUN: %clang -### -S -fprofile-arcs -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR %s
81// RUN: %clang -### -S --coverage -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR %s
82// RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR-NEITHER %s
83// CHECK-PROFILE-DIR: "-coverage-data-file" "abc
84// CHECK-PROFILE-DIR-UNUSED: argument unused
85// CHECK-PROFILE-DIR-UNUSED-NOT: "-coverage-data-file" "abc
86// CHECK-PROFILE-DIR-NEITHER-NOT: argument unused
87
88// RUN: %clang -### -fprofile-arcs -ftest-coverage %s 2>&1 | FileCheck -check-prefix=CHECK-u %s
89// RUN: %clang -### --coverage %s 2>&1 | FileCheck -check-prefix=CHECK-u %s
90// CHECK-u-NOT: "-u{{.*}}"
91
92// RUN: %clang -### -S -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-LLVM %s
93// RUN: %clang -### -S -fprofile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s
94// RUN: %clang -### -S -fprofile-generate=/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-DIR %s
95// RUN: %clang -### -S -fprofile-instr-generate=/tmp/somefile.profraw %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-FILE %s
96// RUN: %clang -### -S -fprofile-generate -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
97// RUN: %clang -### -S -fprofile-generate -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
98// RUN: %clang -### -S -fprofile-generate -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
99// RUN: %clang -### -S -fprofile-generate -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
100// RUN: %clang -### -S -fprofile-instr-generate -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
101// RUN: %clang -### -S -fprofile-instr-generate -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
102// RUN: %clang -### -S -fprofile-instr-generate -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
103// RUN: %clang -### -S -fprofile-instr-generate -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
104// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
105// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
106// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
107// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
108// RUN: %clang -### -S -fprofile-generate=dir -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
109// RUN: %clang -### -S -fprofile-generate=dir -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
110// RUN: %clang -### -S -fprofile-generate=dir -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
111// RUN: %clang -### -S -fprofile-generate=dir -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
112// RUN: %clang -### -S -fprofile-instr-generate=file -fno-profile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s
113// RUN: %clang -### -S -fprofile-instr-generate -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GENERATE %s
114// RUN: %clang -### -S -fprofile-instr-generate -fprofile-generate=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GENERATE %s
115// RUN: %clang -### -S -fprofile-generate=dir -fno-profile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s
116// RUN: %clang -### -S -fprofile-instr-use=file -fno-profile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s
117// RUN: %clang -### -S -fprofile-instr-use=file -fno-profile-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s
118// RUN: %clang -### -S -fprofile-use=file -fno-profile-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s
119// RUN: %clang -### -S -fprofile-use=file -fno-profile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s
120// RUN: %clang -### -S -fcoverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-COVERAGE-AND-GEN %s
121// RUN: %clang -### -S -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s
122// RUN: %clang -### -S -fprofile-instr-generate -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s
123// RUN: %clang -### -S -fprofile-remapping-file foo/bar.txt %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-REMAP %s
124// RUN: %clang -### -S -forder-file-instrumentation %s 2>&1 | FileCheck -check-prefix=CHECK-ORDERFILE-INSTR %s
125// RUN: %clang -### -flto -forder-file-instrumentation %s 2>&1 | FileCheck -check-prefix=CHECK-ORDERFILE-INSTR-LTO %s
126// CHECK-PROFILE-GENERATE: "-fprofile-instrument=clang"
127// CHECK-PROFILE-GENERATE-LLVM: "-fprofile-instrument=llvm"
128// CHECK-PROFILE-GENERATE-DIR: "-fprofile-instrument-path=/some/dir{{/|\\\\}}{{.*}}"
129// CHECK-PROFILE-GENERATE-FILE: "-fprofile-instrument-path=/tmp/somefile.profraw"
130// CHECK-NO-MIX-GEN-USE: '{{[a-z=-]*}}' not allowed with '{{[a-z=-]*}}'
131// CHECK-NO-MIX-GENERATE: '{{[a-z=-]*}}' not allowed with '{{[a-z=-]*}}'
132// CHECK-DISABLE-GEN-NOT: "-fprofile-instrument=clang"
133// CHECK-DISABLE-USE-NOT: "-fprofile-instr-use"
134// CHECK-COVERAGE-AND-GEN: '-fcoverage-mapping' only allowed with '-fprofile-instr-generate'
135// CHECK-DISABLE-COVERAGE-NOT: "-fcoverage-mapping"
136// CHECK-PROFILE-REMAP: "-fprofile-remapping-file=foo/bar.txt"
137// CHECK-ORDERFILE-INSTR: "-forder-file-instrumentation"
138// CHECK-ORDERFILE-INSTR: "-enable-order-file-instrumentation"
139// CHECK-ORDERFILE-INSTR-LTO: "-forder-file-instrumentation"
140// CHECK-ORDERFILE-INSTR-LTO-NOT: "-enable-order-file-instrumentation"
141
142// RUN: %clang -### -S -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s
143// RUN: %clang -### -S -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s
144// RUN: mkdir -p %t.d/some/dir
145// RUN: %clang -### -S -fprofile-use=%t.d/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-DIR %s
146// RUN: %clang -### -S -fprofile-instr-use=/tmp/somefile.prof %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s
147// CHECK-PROFILE-USE: "-fprofile-instrument-use-path=default.profdata"
148// CHECK-PROFILE-USE-DIR: "-fprofile-instrument-use-path={{.*}}.d/some/dir{{/|\\\\}}default.profdata"
149// CHECK-PROFILE-USE-FILE: "-fprofile-instrument-use-path=/tmp/somefile.prof"
150
151// RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
152// RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
153// RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
154// RUN: %clang -### -S -fvectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
155// RUN: %clang -### -S -ftree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
156// RUN: %clang -### -S -fno-tree-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
157// RUN: %clang -### -S -fno-tree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
158// RUN: %clang -### -S -ftree-vectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
159// RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
160// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
161// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
162// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
163// RUN: %clang -### -S -fno-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
164// RUN: %clang -### -S -O1 -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
165// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
166// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
167// RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
168// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
169// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
170// CHECK-VECTORIZE: "-vectorize-loops"
171// CHECK-NO-VECTORIZE-NOT: "-vectorize-loops"
172
173// RUN: %clang -### -S -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
174// RUN: %clang -### -S -fno-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
175// RUN: %clang -### -S -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
176// RUN: %clang -### -S -fslp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
177// RUN: %clang -### -S -ftree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
178// RUN: %clang -### -S -fno-tree-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
179// RUN: %clang -### -S -fno-tree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
180// RUN: %clang -### -S -ftree-slp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
181// RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
182// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
183// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
184// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
185// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
186// RUN: %clang -### -S -fno-slp-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
187// RUN: %clang -### -S -O1 -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
188// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
189// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
190// RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
191// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
192// CHECK-SLP-VECTORIZE: "-vectorize-slp"
193// CHECK-NO-SLP-VECTORIZE-NOT: "-vectorize-slp"
194
195// RUN: %clang -### -S -fextended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-EXTENDED-IDENTIFIERS %s
196// RUN: not %clang -### -S -fno-extended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-NO-EXTENDED-IDENTIFIERS %s
197// CHECK-EXTENDED-IDENTIFIERS: "-cc1"
198// CHECK-EXTENDED-IDENTIFIERS-NOT: "-fextended-identifiers"
199// CHECK-NO-EXTENDED-IDENTIFIERS: error: unsupported option '-fno-extended-identifiers'
200
201// RUN: %clang -### -S -fno-pascal-strings -mpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-M-PASCAL-STRINGS %s
202// CHECK-M-PASCAL-STRINGS: "-fpascal-strings"
203
204// RUN: %clang -### -S -fpascal-strings -mno-pascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-NO-M-PASCAL-STRINGS %s
205// CHECK-NO-M-PASCAL-STRINGS-NOT: "-fpascal-strings"
206
207// RUN: %clang -### -S -O4 %s 2>&1 | FileCheck -check-prefix=CHECK-MAX-O %s
208// CHECK-MAX-O: warning: -O4 is equivalent to -O3
209// CHECK-MAX-O: -O3
210
211// RUN: %clang -S -O20 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-O %s
212// CHECK-INVALID-O: warning: optimization level '-O20' is not supported; using '-O3' instead
213
214// RUN: %clang -### -S -finput-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-CHARSET %s
215// CHECK-INVALID-CHARSET: error: invalid value 'iso-8859-1' in '-finput-charset=iso-8859-1'
216
217// RUN: %clang -### -S -fexec-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-INPUT-CHARSET %s
218// CHECK-INVALID-INPUT-CHARSET: error: invalid value 'iso-8859-1' in '-fexec-charset=iso-8859-1'
219
220// Test that we don't error on these.
221// RUN: %clang -### -S -Werror                                                \
222// RUN:     -falign-functions -falign-functions=2 -fno-align-functions        \
223// RUN:     -fasynchronous-unwind-tables -fno-asynchronous-unwind-tables      \
224// RUN:     -fbuiltin -fno-builtin                                            \
225// RUN:     -fdiagnostics-show-location=once                                  \
226// RUN:     -ffloat-store -fno-float-store                                    \
227// RUN:     -feliminate-unused-debug-types -fno-eliminate-unused-debug-types  \
228// RUN:     -fgcse -fno-gcse                                                  \
229// RUN:     -fident -fno-ident                                                \
230// RUN:     -fimplicit-templates -fno-implicit-templates                      \
231// RUN:     -finput-charset=UTF-8                                             \
232// RUN:     -fexec-charset=UTF-8                                             \
233// RUN:     -fivopts -fno-ivopts                                              \
234// RUN:     -fnon-call-exceptions -fno-non-call-exceptions                    \
235// RUN:     -fpermissive -fno-permissive                                      \
236// RUN:     -fdefer-pop -fno-defer-pop                                        \
237// RUN:     -fprefetch-loop-arrays -fno-prefetch-loop-arrays                  \
238// RUN:     -fprofile-correction -fno-profile-correction                      \
239// RUN:     -fprofile-values -fno-profile-values                              \
240// RUN:     -frounding-math -fno-rounding-math                                \
241// RUN:     -fsee -fno-see                                                    \
242// RUN:     -ftracer -fno-tracer                                              \
243// RUN:     -funroll-all-loops -fno-unroll-all-loops                          \
244// RUN:     -fuse-ld=gold                                                     \
245// RUN:     -fno-builtin-foobar                                               \
246// RUN:     -fno-builtin-strcat -fno-builtin-strcpy                           \
247// RUN:     -fno-var-tracking                                                 \
248// RUN:     -fno-unsigned-char                                                \
249// RUN:     -fno-signed-char                                                  \
250// RUN:     -fstrength-reduce -fno-strength-reduce                            \
251// RUN:     -finline-limit=1000                                               \
252// RUN:     -finline-limit                                                    \
253// RUN:     -flto=1                                                           \
254// RUN:     -falign-labels                                                    \
255// RUN:     -falign-labels=100                                                \
256// RUN:     -falign-loops                                                     \
257// RUN:     -falign-loops=100                                                 \
258// RUN:     -falign-jumps                                                     \
259// RUN:     -falign-jumps=100                                                 \
260// RUN:     -fexcess-precision=100                                            \
261// RUN:     -fbranch-count-reg                                                \
262// RUN:     -fcaller-saves                                                    \
263// RUN:     -fno-default-inline -fdefault-inline                              \
264// RUN:     -fgcse-after-reload                                               \
265// RUN:     -fgcse-las                                                        \
266// RUN:     -fgcse-sm                                                         \
267// RUN:     -fipa-cp                                                          \
268// RUN:     -finline-functions-called-once                                    \
269// RUN:     -fmodulo-sched                                                    \
270// RUN:     -fmodulo-sched-allow-regmoves                                     \
271// RUN:     -fpeel-loops                                                      \
272// RUN:     -frename-registers                                                \
273// RUN:     -fschedule-insns2                                                 \
274// RUN:     -fsingle-precision-constant                                       \
275// RUN:     -ftree_loop_im                                                    \
276// RUN:     -ftree_loop_ivcanon                                               \
277// RUN:     -ftree_loop_linear                                                \
278// RUN:     -funsafe-loop-optimizations                                       \
279// RUN:     -fuse-linker-plugin                                               \
280// RUN:     -fvect-cost-model                                                 \
281// RUN:     -fvariable-expansion-in-unroller                                  \
282// RUN:     -fweb                                                             \
283// RUN:     -fwhole-program                                                   \
284// RUN:     -fno-tree-dce -ftree-dce                                          \
285// RUN:     -fno-tree-ter -ftree-ter                                          \
286// RUN:     -fno-tree-vrp -ftree-vrp                                          \
287// RUN:     -fno-delete-null-pointer-checks -fdelete-null-pointer-checks      \
288// RUN:     -fno-inline-small-functions -finline-small-functions              \
289// RUN:     -fno-fat-lto-objects -ffat-lto-objects                            \
290// RUN:     -fno-merge-constants -fmerge-constants                            \
291// RUN:     -fno-merge-all-constants -fmerge-all-constants                    \
292// RUN:     -fno-caller-saves -fcaller-saves                                  \
293// RUN:     -fno-reorder-blocks -freorder-blocks                              \
294// RUN:     -fno-schedule-insns2 -fschedule-insns2                            \
295// RUN:     -fno-stack-check                                                  \
296// RUN:     -fno-check-new -fcheck-new                                        \
297// RUN:     -ffriend-injection                                                \
298// RUN:     -fno-implement-inlines -fimplement-inlines                        \
299// RUN:     -fstack-check                                                     \
300// RUN:     -fforce-addr                                                      \
301// RUN:     -malign-functions=100                                             \
302// RUN:     -malign-loops=100                                                 \
303// RUN:     -malign-jumps=100                                                 \
304// RUN:     %s 2>&1 | FileCheck --check-prefix=IGNORE %s
305// IGNORE-NOT: error: unknown argument
306
307// Test that the warning is displayed on these.
308// RUN: %clang -###                                                           \
309// RUN: -finline-limit=1000                                                   \
310// RUN: -finline-limit                                                        \
311// RUN: -fexpensive-optimizations                                             \
312// RUN: -fno-expensive-optimizations                                          \
313// RUN: -fno-defer-pop                                                        \
314// RUN: -fkeep-inline-functions                                               \
315// RUN: -fno-keep-inline-functions                                            \
316// RUN: -freorder-blocks                                                      \
317// RUN: -ffloat-store                                                         \
318// RUN: -fgcse                                                                \
319// RUN: -fivopts                                                              \
320// RUN: -fprefetch-loop-arrays                                                \
321// RUN: -fprofile-correction                                                  \
322// RUN: -fprofile-values                                                      \
323// RUN: -frounding-math                                                       \
324// RUN: -fschedule-insns                                                      \
325// RUN: -fsignaling-nans                                                      \
326// RUN: -fstrength-reduce                                                     \
327// RUN: -ftracer                                                              \
328// RUN: -funroll-all-loops                                                    \
329// RUN: -funswitch-loops                                                      \
330// RUN: -flto=1                                                               \
331// RUN: -falign-labels                                                        \
332// RUN: -falign-labels=100                                                    \
333// RUN: -falign-loops                                                         \
334// RUN: -falign-loops=100                                                     \
335// RUN: -falign-jumps                                                         \
336// RUN: -falign-jumps=100                                                     \
337// RUN: -fexcess-precision=100                                                \
338// RUN: -fbranch-count-reg                                                    \
339// RUN: -fcaller-saves                                                        \
340// RUN: -fno-default-inline                                                   \
341// RUN: -fgcse-after-reload                                                   \
342// RUN: -fgcse-las                                                            \
343// RUN: -fgcse-sm                                                             \
344// RUN: -fipa-cp                                                              \
345// RUN: -finline-functions-called-once                                        \
346// RUN: -fmodulo-sched                                                        \
347// RUN: -fmodulo-sched-allow-regmoves                                         \
348// RUN: -fpeel-loops                                                          \
349// RUN: -frename-registers                                                    \
350// RUN: -fschedule-insns2                                                     \
351// RUN: -fsingle-precision-constant                                           \
352// RUN: -ftree_loop_im                                                        \
353// RUN: -ftree_loop_ivcanon                                                   \
354// RUN: -ftree_loop_linear                                                    \
355// RUN: -funsafe-loop-optimizations                                           \
356// RUN: -fuse-linker-plugin                                                   \
357// RUN: -fvect-cost-model                                                     \
358// RUN: -fvariable-expansion-in-unroller                                      \
359// RUN: -fweb                                                                 \
360// RUN: -fwhole-program                                                       \
361// RUN: -fcaller-saves                                                        \
362// RUN: -freorder-blocks                                                      \
363// RUN: -ffat-lto-objects                                                     \
364// RUN: -fmerge-constants                                                     \
365// RUN: -finline-small-functions                                              \
366// RUN: -ftree-dce                                                            \
367// RUN: -ftree-ter                                                            \
368// RUN: -ftree-vrp                                                            \
369// RUN: -fno-devirtualize                                                     \
370// RUN: -fno-devirtualize-speculatively                                       \
371// RUN: -fslp-vectorize-aggressive                                            \
372// RUN: -fno-slp-vectorize-aggressive                                         \
373// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s
374// CHECK-WARNING-DAG: optimization flag '-finline-limit=1000' is not supported
375// CHECK-WARNING-DAG: optimization flag '-finline-limit' is not supported
376// CHECK-WARNING-DAG: optimization flag '-fexpensive-optimizations' is not supported
377// CHECK-WARNING-DAG: optimization flag '-fno-expensive-optimizations' is not supported
378// CHECK-WARNING-DAG: optimization flag '-fno-defer-pop' is not supported
379// CHECK-WARNING-DAG: optimization flag '-fkeep-inline-functions' is not supported
380// CHECK-WARNING-DAG: optimization flag '-fno-keep-inline-functions' is not supported
381// CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported
382// CHECK-WARNING-DAG: optimization flag '-ffloat-store' is not supported
383// CHECK-WARNING-DAG: optimization flag '-fgcse' is not supported
384// CHECK-WARNING-DAG: optimization flag '-fivopts' is not supported
385// CHECK-WARNING-DAG: optimization flag '-fprefetch-loop-arrays' is not supported
386// CHECK-WARNING-DAG: optimization flag '-fprofile-correction' is not supported
387// CHECK-WARNING-DAG: optimization flag '-fprofile-values' is not supported
388// CHECK-WARNING-DAG: optimization flag '-frounding-math' is not supported
389// CHECK-WARNING-DAG: optimization flag '-fschedule-insns' is not supported
390// CHECK-WARNING-DAG: optimization flag '-fsignaling-nans' is not supported
391// CHECK-WARNING-DAG: optimization flag '-fstrength-reduce' is not supported
392// CHECK-WARNING-DAG: optimization flag '-ftracer' is not supported
393// CHECK-WARNING-DAG: optimization flag '-funroll-all-loops' is not supported
394// CHECK-WARNING-DAG: optimization flag '-funswitch-loops' is not supported
395// CHECK-WARNING-DAG: unsupported argument '1' to option 'flto='
396// CHECK-WARNING-DAG: optimization flag '-falign-labels' is not supported
397// CHECK-WARNING-DAG: optimization flag '-falign-labels=100' is not supported
398// CHECK-WARNING-DAG: optimization flag '-falign-loops' is not supported
399// CHECK-WARNING-DAG: optimization flag '-falign-loops=100' is not supported
400// CHECK-WARNING-DAG: optimization flag '-falign-jumps' is not supported
401// CHECK-WARNING-DAG: optimization flag '-falign-jumps=100' is not supported
402// CHECK-WARNING-DAG: optimization flag '-fexcess-precision=100' is not supported
403// CHECK-WARNING-DAG: optimization flag '-fbranch-count-reg' is not supported
404// CHECK-WARNING-DAG: optimization flag '-fcaller-saves' is not supported
405// CHECK-WARNING-DAG: optimization flag '-fno-default-inline' is not supported
406// CHECK-WARNING-DAG: optimization flag '-fgcse-after-reload' is not supported
407// CHECK-WARNING-DAG: optimization flag '-fgcse-las' is not supported
408// CHECK-WARNING-DAG: optimization flag '-fgcse-sm' is not supported
409// CHECK-WARNING-DAG: optimization flag '-fipa-cp' is not supported
410// CHECK-WARNING-DAG: optimization flag '-finline-functions-called-once' is not supported
411// CHECK-WARNING-DAG: optimization flag '-fmodulo-sched' is not supported
412// CHECK-WARNING-DAG: optimization flag '-fmodulo-sched-allow-regmoves' is not supported
413// CHECK-WARNING-DAG: optimization flag '-fpeel-loops' is not supported
414// CHECK-WARNING-DAG: optimization flag '-frename-registers' is not supported
415// CHECK-WARNING-DAG: optimization flag '-fschedule-insns2' is not supported
416// CHECK-WARNING-DAG: optimization flag '-fsingle-precision-constant' is not supported
417// CHECK-WARNING-DAG: optimization flag '-ftree_loop_im' is not supported
418// CHECK-WARNING-DAG: optimization flag '-ftree_loop_ivcanon' is not supported
419// CHECK-WARNING-DAG: optimization flag '-ftree_loop_linear' is not supported
420// CHECK-WARNING-DAG: optimization flag '-funsafe-loop-optimizations' is not supported
421// CHECK-WARNING-DAG: optimization flag '-fuse-linker-plugin' is not supported
422// CHECK-WARNING-DAG: optimization flag '-fvect-cost-model' is not supported
423// CHECK-WARNING-DAG: optimization flag '-fvariable-expansion-in-unroller' is not supported
424// CHECK-WARNING-DAG: optimization flag '-fweb' is not supported
425// CHECK-WARNING-DAG: optimization flag '-fwhole-program' is not supported
426// CHECK-WARNING-DAG: optimization flag '-fcaller-saves' is not supported
427// CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported
428// CHECK-WARNING-DAG: optimization flag '-ffat-lto-objects' is not supported
429// CHECK-WARNING-DAG: optimization flag '-fmerge-constants' is not supported
430// CHECK-WARNING-DAG: optimization flag '-finline-small-functions' is not supported
431// CHECK-WARNING-DAG: optimization flag '-ftree-dce' is not supported
432// CHECK-WARNING-DAG: optimization flag '-ftree-ter' is not supported
433// CHECK-WARNING-DAG: optimization flag '-ftree-vrp' is not supported
434// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize' is not supported
435// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize-speculatively' is not supported
436// CHECK-WARNING-DAG: the flag '-fslp-vectorize-aggressive' has been deprecated and will be ignored
437// CHECK-WARNING-DAG: the flag '-fno-slp-vectorize-aggressive' has been deprecated and will be ignored
438
439// Test that we mute the warning on these
440// RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument              \
441// RUN:     %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING1 %s
442// RUN: %clang -### -finline-limit -Wno-invalid-command-line-argument                   \
443// RUN:     %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s
444// RUN: %clang -### -finline-limit \
445// RUN:     -Winvalid-command-line-argument -Wno-ignored-optimization-argument          \
446// RUN:     %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s
447// CHECK-NO-WARNING1-NOT: optimization flag '-finline-limit=1000' is not supported
448// CHECK-NO-WARNING2-NOT: optimization flag '-finline-limit' is not supported
449
450// Test that an ignored optimization argument only prints 1 warning,
451// not both a warning about not claiming the arg, *and* about not supporting
452// the arg; and that adding -Wno-ignored-optimization silences the warning.
453//
454// RUN: %clang -### -fprofile-correction %s 2>&1 \
455// RUN:   | FileCheck --check-prefix=CHECK-NO-WARNING3 %s
456// CHECK-NO-WARNING3: optimization flag '-fprofile-correction' is not supported
457// CHECK-NO-WARNING3-NOT: argument unused
458// RUN: %clang -### -fprofile-correction -Wno-ignored-optimization-argument %s 2>&1 \
459// RUN:   | FileCheck --check-prefix=CHECK-NO-WARNING4 %s
460// CHECK-NO-WARNING4-NOT: not supported
461// CHECK-NO-WARNING4-NOT: argument unused
462
463// RUN: %clang -### -S -fsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN1 %s
464// CHAR-SIGN1-NOT: -fno-signed-char
465
466// RUN: %clang -### -S -funsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN2 %s
467// CHAR-SIGN2: -fno-signed-char
468
469// RUN: %clang -### -S -fno-signed-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN3 %s
470// CHAR-SIGN3: -fno-signed-char
471
472// RUN: %clang -### -S -fno-unsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN4 %s
473// CHAR-SIGN4-NOT: -fno-signed-char
474
475// RUN: %clang -target x86_64-unknown-none-none -### -fshort-wchar -fno-short-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR1 -check-prefix=DELIMITERS %s
476// RUN: %clang -target x86_64-unknown-none-none -### -fno-short-wchar -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR2 -check-prefix=DELIMITERS %s
477// Make sure we don't match the -NOT lines with the linker invocation.
478// Delimiters match the start of the cc1 and the start of the linker lines
479// DELIMITERS: {{^ *"}}
480// CHECK-WCHAR1: -fwchar-type=int
481// CHECK-WCHAR1-NOT: -fwchar-type=short
482// CHECK-WCHAR2: -fwchar-type=short
483// CHECK-WCHAR2-NOT: -fwchar-type=int
484// DELIMITERS: {{^ *"}}
485
486// RUN: %clang -### -fno-experimental-new-pass-manager -fexperimental-new-pass-manager %s 2>&1 | FileCheck --check-prefix=CHECK-PM --check-prefix=CHECK-NEW-PM %s
487// RUN: %clang -### -fexperimental-new-pass-manager -fno-experimental-new-pass-manager %s 2>&1 | FileCheck --check-prefix=CHECK-PM --check-prefix=CHECK-NO-NEW-PM %s
488// CHECK-PM-NOT: argument unused
489// CHECK-NEW-PM: -fexperimental-new-pass-manager
490// CHECK-NEW-PM-NOT: -fno-experimental-new-pass-manager
491// CHECK-NO-NEW-PM: -fno-experimental-new-pass-manager
492// CHECK-NO-NEW-PM-NOT: -fexperimental-new-pass-manager
493
494// RUN: %clang -### -S -fstrict-return %s 2>&1 | FileCheck -check-prefix=CHECK-STRICT-RETURN %s
495// RUN: %clang -### -S -fno-strict-return %s 2>&1 | FileCheck -check-prefix=CHECK-NO-STRICT-RETURN %s
496// CHECK-STRICT-RETURN-NOT: "-fno-strict-return"
497// CHECK-NO-STRICT-RETURN: "-fno-strict-return"
498
499// RUN: %clang -### -S -fno-debug-info-for-profiling -fdebug-info-for-profiling %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DEBUG %s
500// RUN: %clang -### -S -fdebug-info-for-profiling -fno-debug-info-for-profiling %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-DEBUG %s
501// CHECK-PROFILE-DEBUG: -fdebug-info-for-profiling
502// CHECK-NO-PROFILE-DEBUG-NOT: -fdebug-info-for-profiling
503
504// RUN: %clang -### -S -fallow-editor-placeholders %s 2>&1 | FileCheck -check-prefix=CHECK-ALLOW-PLACEHOLDERS %s
505// RUN: %clang -### -S -fno-allow-editor-placeholders %s 2>&1 | FileCheck -check-prefix=CHECK-NO-ALLOW-PLACEHOLDERS %s
506// CHECK-ALLOW-PLACEHOLDERS: -fallow-editor-placeholders
507// CHECK-NO-ALLOW-PLACEHOLDERS-NOT: -fallow-editor-placeholders
508
509// RUN: %clang -### -target x86_64-unknown-windows-msvc -fno-short-wchar %s 2>&1 | FileCheck -check-prefix CHECK-WINDOWS-ISO10646 %s
510// CHECK-WINDOWS-ISO10646: "-fwchar-type=int"
511// CHECK-WINDOWS-ISO10646: "-fsigned-wchar"
512
513// RUN: %clang -### -S -fcf-protection %s 2>&1 | FileCheck -check-prefix=CHECK-CF-PROTECTION-FULL %s
514// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CF-PROTECTION-FULL %s
515// RUN: %clang -### -S -fcf-protection=full %s 2>&1 | FileCheck -check-prefix=CHECK-CF-PROTECTION-FULL %s
516// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CF-PROTECTION-FULL %s
517// CHECK-CF-PROTECTION-FULL: -fcf-protection=full
518// CHECK-NO-CF-PROTECTION-FULL-NOT: -fcf-protection=full
519// RUN: %clang -### -S -fcf-protection=return %s 2>&1 | FileCheck -check-prefix=CHECK-CF-PROTECTION-RETURN %s
520// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CF-PROTECTION-RETURN %s
521// CHECK-CF-PROTECTION-RETURN: -fcf-protection=return
522// CHECK-NO-CF-PROTECTION-RETURN-NOT: -fcf-protection=return
523// RUN: %clang -### -S -fcf-protection=branch %s 2>&1 | FileCheck -check-prefix=CHECK-CF-PROTECTION-BRANCH %s
524// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CF-PROTECTION-BRANCH %s
525// CHECK-CF-PROTECTION-BRANCH: -fcf-protection=branch
526// CHECK-NO-CF-PROTECTION-BRANCH-NOT: -fcf-protection=branch
527
528// RUN: %clang -### -S -fdiscard-value-names %s 2>&1 | FileCheck -check-prefix=CHECK-DISCARD-NAMES %s
529// RUN: %clang -### -S -fno-discard-value-names %s 2>&1 | FileCheck -check-prefix=CHECK-NO-DISCARD-NAMES %s
530// CHECK-DISCARD-NAMES: "-discard-value-names"
531// CHECK-NO-DISCARD-NAMES-NOT: "-discard-value-names"
532//
533// RUN: %clang -### -S -fmerge-all-constants %s 2>&1 | FileCheck -check-prefix=CHECK-MERGE-ALL-CONSTANTS %s
534// RUN: %clang -### -S -fno-merge-all-constants %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MERGE-ALL-CONSTANTS %s
535// RUN: %clang -### -S -fmerge-all-constants -fno-merge-all-constants %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MERGE-ALL-CONSTANTS %s
536// RUN: %clang -### -S -fno-merge-all-constants -fmerge-all-constants %s 2>&1 | FileCheck -check-prefix=CHECK-MERGE-ALL-CONSTANTS %s
537// CHECK-NO-MERGE-ALL-CONSTANTS-NOT: "-fmerge-all-constants"
538// CHECK-MERGE-ALL-CONSTANTS: "-fmerge-all-constants"
539
540// RUN: %clang -### -S -fdelete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NULL-POINTER-CHECKS %s
541// RUN: %clang -### -S -fno-delete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NO-NULL-POINTER-CHECKS %s
542// RUN: %clang -### -S -fdelete-null-pointer-checks -fno-delete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NO-NULL-POINTER-CHECKS %s
543// RUN: %clang -### -S -fno-delete-null-pointer-checks -fdelete-null-pointer-checks %s 2>&1 | FileCheck -check-prefix=CHECK-NULL-POINTER-CHECKS %s
544// CHECK-NO-NULL-POINTER-CHECKS: "-fno-delete-null-pointer-checks"
545// CHECK-NULL-POINTER-CHECKS-NOT: "-fno-delete-null-pointer-checks"
546
547// RUN: %clang -### -S -fomit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-OMIT-FP-PG %s
548// RUN: %clang -### -S -fomit-frame-pointer -fno-omit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-MIX-NO-OMIT-FP-PG %s
549// CHECK-NO-MIX-OMIT-FP-PG: '-fomit-frame-pointer' not allowed with '-pg'
550// CHECK-MIX-NO-OMIT-FP-PG-NOT: '-fomit-frame-pointer' not allowed with '-pg'
551
552// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s
553// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s
554// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-gcc-switches -frecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s
555// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-gcc-switches -fno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s
556// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s
557// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s
558// RUN: %clang -### -S -target x86_64-unknown-linux -fno-record-command-line -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES %s
559// RUN: %clang -### -S -target x86_64-unknown-linux -frecord-command-line -fno-record-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-NO-RECORD-GCC-SWITCHES %s
560// Test with a couple examples of non-ELF object file formats
561// RUN: %clang -### -S -target x86_64-unknown-macosx -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES-ERROR %s
562// RUN: %clang -### -S -target x86_64-unknown-windows -frecord-command-line %s 2>&1 | FileCheck -check-prefix=CHECK-RECORD-GCC-SWITCHES-ERROR %s
563// CHECK-RECORD-GCC-SWITCHES: "-record-command-line"
564// CHECK-NO-RECORD-GCC-SWITCHES-NOT: "-record-command-line"
565// CHECK-RECORD-GCC-SWITCHES-ERROR: error: unsupported option '-frecord-command-line' for target
566
567// RUN: %clang -### -S -ftrivial-auto-var-init=uninitialized %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-UNINIT %s
568// RUN: %clang -### -S -ftrivial-auto-var-init=pattern %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-PATTERN %s
569// RUN: %clang -### -S -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO-GOOD %s
570// RUN: %clang -### -S -ftrivial-auto-var-init=zero %s 2>&1 | FileCheck -check-prefix=CHECK-TRIVIAL-ZERO-BAD %s
571// CHECK-TRIVIAL-UNINIT-NOT: hasn't been enabled
572// CHECK-TRIVIAL-PATTERN-NOT: hasn't been enabled
573// CHECK-TRIVIAL-ZERO-GOOD-NOT: hasn't been enabled
574// CHECK-TRIVIAL-ZERO-BAD: hasn't been enabled
575