[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / fast-math.c
blobffd081948914d61f0de0ffde47915ef596287abd
1 // Test that the GCC fast-math floating point flags get lowered to the correct
2 // permutation of Clang frontend flags. This is non-trivial for a few reasons.
3 // First, the GCC flags have many different and surprising effects. Second,
4 // LLVM only supports three switches which is more coarse grained than GCC's
5 // support.
6 //
7 // Both of them use gcc driver for as.
8 //
9 // RUN: %clang -### -fno-honor-infinities -c %s 2>&1 \
10 // RUN: | FileCheck --check-prefixes=CHECK,NINF,NO-NNAN,NO-FINITE-ONLY %s
11 // infinites [sic] is a supported alternative spelling of infinities.
12 // RUN: %clang -### -fno-honor-infinites -c %s 2>&1 \
13 // RUN: | FileCheck --check-prefixes=CHECK,NINF,NO-NNAN,NO-FINITE-ONLY %s
15 // RUN: %clang -### -fno-fast-math -fno-honor-infinities -c %s 2>&1 \
16 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NINF,NO-NNAN,NO-FINITE-ONLY %s
18 // RUN: %clang -### -fno-honor-infinities -fno-fast-math -c %s 2>&1 \
19 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-NINF,NO-NNAN,NO-FINITE-ONLY %s
21 // RUN: %clang -### -fno-signed-zeros -c %s 2>&1 \
22 // RUN: | FileCheck --check-prefixes=CHECK,NSZ,NOROUNDING %s
24 // RUN: %clang -### -fno-fast-math -fno-signed-zeros -c %s 2>&1 \
25 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NSZ %s
27 // RUN: %clang -### -fno-signed-zeros -fno-fast-math -c %s 2>&1 \
28 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-NSZ,NOROUNDING %s
30 // RUN: %clang -### -freciprocal-math -c %s 2>&1 \
31 // RUN: | FileCheck --check-prefixes=CHECK,ARCP,NOROUNDING %s
33 // RUN: %clang -### -fno-fast-math -freciprocal-math -c %s 2>&1 \
34 // RUN: | FileCheck --check-prefixes=CHECK,ARCP,NOROUNDING %s
36 // RUN: %clang -### -freciprocal-math -fno-fast-math -c %s 2>&1 \
37 // RUN: | FileCheck --check-prefixes=CHECK,NO-ARCP,NOROUNDING %s
39 // RUN: %clang -### -fno-honor-nans -c %s 2>&1 \
40 // RUN: | FileCheck --check-prefixes=CHECK,NNAN,NO-NINF,NO-FINITE-ONLY,NOROUNDING %s
42 // RUN: %clang -### -fno-fast-math -fno-honor-nans -c %s 2>&1 \
43 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NNAN,NO-NINF,NO-FINITE-ONLY,NOROUNDING %s
45 // RUN: %clang -### -fno-honor-nans -fno-fast-math -c %s 2>&1 \
46 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-NNAN,NO-NINF,NO-FINITE-ONLY,NOROUNDING %s
48 // RUN: %clang -### -ffast-math -fno-approx-func -c %s 2>&1 \
49 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NINF,NNAN,FINITE-ONLY,NSZ,ARCP,NO-AFN,NO-ERRNO,NOROUNDING %s
51 // RUN: %clang -### -fno-approx-func -ffast-math -c %s 2>&1 \
52 // RUN: | FileCheck --check-prefixes=CHECK,FAST,NINF,NNAN,FINITE-ONLY,NSZ,ARCP,AFN,NO-ERRNO,NOROUNDING %s
54 // RUN: %clang -### -fapprox-func -c %s 2>&1 \
55 // RUN: | FileCheck --check-prefixes=CHECK,AFN %s
57 // RUN: %clang -### -fno-fast-math -fapprox-func -c %s 2>&1 \
58 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,AFN,NOROUNDING %s
60 // RUN: %clang -### -fapprox-func -fno-fast-math -c %s 2>&1 \
61 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-AFN %s
63 // RUN: %clang -### -fmath-errno -c %s 2>&1 \
64 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,ERRNO %s
66 // RUN: %clang -### -fmath-errno -fno-math-errno -c %s 2>&1 \
67 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
69 // Target defaults for -fmath-errno (reusing the above checks).
70 // RUN: %clang -### --target=i686-unknown-linux -c %s 2>&1 \
71 // RUN: | FileCheck --check-prefixes=CHECK,ERRNO %s
72 // RUN: %clang -### -target i686-apple-darwin -c %s 2>&1 \
73 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
74 // RUN: %clang -### --target=x86_64-unknown-freebsd -c %s 2>&1 \
75 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
76 // RUN: %clang -### --target=x86_64-unknown-netbsd -c %s 2>&1 \
77 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
78 // RUN: %clang -### --target=x86_64-unknown-openbsd -c %s 2>&1 \
79 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
80 // RUN: %clang -### --target=x86_64-unknown-haiku -c %s 2>&1 \
81 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
82 // RUN: %clang -### --target=x86_64-unknown-dragonfly -c %s 2>&1 \
83 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
84 // RUN: %clang -### --target=x86_64-fuchsia -c %s 2>&1 \
85 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
86 // RUN: %clang -### --target=x86_64-linux-android -c %s 2>&1 \
87 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
88 // RUN: %clang -### --target=x86_64-linux-musl -c %s 2>&1 \
89 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
90 // RUN: %clang -### --target=amdgcn-amd-amdhsa -nogpuinc -nogpulib -c %s 2>&1 \
91 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
92 // RUN: %clang -### --target=amdgcn-amd-amdpal -c %s 2>&1 \
93 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
94 // RUN: %clang -### --target=amdgcn-mesa-mesa3d -c %s 2>&1 \
95 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
97 // Check that -ffast-math disables -fmath-errno, and -fno-fast-math merely
98 // preserves the target default. Also check various flag set operations between
99 // the two flags. (Resuses above checks.)
100 // RUN: %clang -### -ffast-math -c %s 2>&1 \
101 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
102 // RUN: %clang -### -fmath-errno -ffast-math -c %s 2>&1 \
103 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
104 // RUN: %clang -### -ffast-math -fmath-errno -c %s 2>&1 \
105 // RUN: | FileCheck --check-prefixes=CHECK,ERRNO %s
106 // RUN: %clang -### --target=i686-unknown-linux -fno-fast-math -c %s 2>&1 \
107 // RUN: | FileCheck --check-prefixes=CHECK,ERRNO %s
108 // RUN: %clang -### --target=i686-unknown-linux -fno-math-errno -fno-fast-math -c %s 2>&1 \
109 // RUN: | FileCheck --check-prefixes=CHECK,ERRNO %s
110 // RUN: %clang -### -target i686-apple-darwin -fno-fast-math -c %s 2>&1 \
111 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
112 // RUN: %clang -### -target i686-apple-darwin -fno-math-errno -fno-fast-math -c %s 2>&1 \
113 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
114 // RUN: %clang -### -fno-fast-math -fno-math-errno -c %s 2>&1 \
115 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO %s
117 // RUN: %clang -### -fno-math-errno -fassociative-math -freciprocal-math \
118 // RUN: -fno-signed-zeros -fno-trapping-math -fapprox-func -c %s 2>&1 \
119 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO,UNSAFE,ARCP,NSZ,NO-TRAPPING,REASSOC %s
121 // RUN: %clang -### -fno-fast-math -fno-math-errno -fassociative-math -freciprocal-math \
122 // RUN: -fno-signed-zeros -fno-trapping-math -fapprox-func -c %s 2>&1 \
123 // RUN: | FileCheck --check-prefixes=CHECK,NO-ERRNO,UNSAFE,ARCP,NSZ,NO-TRAPPING,REASSOC %s
125 // The 2nd -fno-fast-math overrides -fassociative-math.
127 // RUN: %clang -### -fno-fast-math -fno-math-errno -fassociative-math -freciprocal-math \
128 // RUN: -fno-fast-math -fno-signed-zeros -fno-trapping-math -c %s 2>&1 \
129 // RUN: | FileCheck --check-prefixes=CHECK,NO-UNSAFE,NO-REASSOC,NO-ARCP,NSZ,NO-TRAPPING %s
131 // Check that various umbrella flags also enable these frontend options.
132 // RUN: %clang -### -ffast-math -c %s 2>&1 \
133 // RUN: | FileCheck --check-prefixes=CHECK,FAST,NINF,NNAN,FINITE-ONLY,REASSOC,NSZ,ARCP,AFN,CONTRACT-FAST,NO-ERRNO,NOROUNDING %s
134 // RUN: %clang -### -ffinite-math-only -c %s 2>&1 \
135 // RUN: | FileCheck --check-prefixes=CHECK,NINF,NNAN,FINITE-ONLY %s
136 // RUN: %clang -### -funsafe-math-optimizations -fno-math-errno -c %s 2>&1 \
137 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-NNAN,NO-NINF,NO-FINITE-ONLY,REASSOC,NSZ,ARCP,AFN,CONTRACT-FAST,NO-ERRNO,NOROUNDING %s
139 // One umbrella flag is *really* weird and also changes the semantics of the
140 // program by adding a special preprocessor macro. Check that the frontend flag
141 // modeling this semantic change is provided. Also check that the flag is not
142 // present if any of the optimizations are disabled.
143 // RUN: %clang -### -fno-fast-math -ffast-math -c %s 2>&1 \
144 // RUN: | FileCheck --check-prefixes=CHECK,FAST,NINF,NNAN,FINITE-ONLY,REASSOC,NSZ,ARCP,AFN,CONTRACT-FAST,NO-ERRNO,NOROUNDING %s
145 // RUN: %clang -### -funsafe-math-optimizations -ffinite-math-only \
146 // RUN: -fno-math-errno -ffp-contract=fast -fno-rounding-math -c %s 2>&1 \
147 // RUN: | FileCheck --check-prefixes=CHECK,FAST,NINF,NNAN,FINITE-ONLY,NSZ,ARCP,AFN,CONTRACT-FAST,NO-ERRNO,NOROUNDING %s
148 // RUN: %clang -### -fno-honor-infinities -fno-honor-nans -fno-math-errno \
149 // RUN: -fassociative-math -freciprocal-math -fno-signed-zeros -fapprox-func \
150 // RUN: -fno-trapping-math -ffp-contract=fast -fno-rounding-math -c %s 2>&1 \
151 // RUN: | FileCheck --check-prefixes=CHECK,FAST,NINF,NNAN,FINITE-ONLY,NSZ,ARCP,AFN,CONTRACT-FAST,NO-ERRNO,NOROUNDING %s
153 // RUN: %clang -### -ffast-math -fno-fast-math -c %s 2>&1 \
154 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-NINF,NO-NNAN,NO-FINITE-ONLY,NO-REASSOC,NO-NSZ,NO-ARCP,NO-AFN,NOROUNDING %s
155 // RUN: %clang -### -ffast-math -fno-finite-math-only -c %s 2>&1 \
156 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-NINF,NO-NNAN,NO-FINITE-ONLY,REASSOC,NSZ,ARCP,AFN,CONTRACT-FAST,NOROUNDING %s
158 // FIXME: This case leaves nnan and ninf. That seems wrong!
159 // RUN: %clang -### -ffast-math -fno-unsafe-math-optimizations -c %s 2>&1 \
160 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NINF,NNAN,FINITE-ONLY,NO-REASSOC,NO-NSZ,NO-ARCP,NO-AFN,NOROUNDING,NO-TRAPPING %s
161 // RUN: %clang -### -ffast-math -fmath-errno -c %s 2>&1 \
162 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NINF,NNAN,FINITE-ONLY,REASSOC,NSZ,ARCP,AFN,CONTRACT-FAST,ERRNO,NOROUNDING %s
163 // RUN: %clang -### -ffast-math -fno-associative-math -c %s 2>&1 \
164 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NINF,NNAN,FINITE-ONLY,NO-REASSOC,NSZ,ARCP,AFN,CONTRACT-FAST,NO-ERRNO,NOROUNDING %s
166 // Check various means of disabling these flags, including disabling them after
167 // they've been enabled via an umbrella flag.
168 // RUN: %clang -### -fno-honor-infinities -fhonor-infinities -c %s 2>&1 \
169 // RUN: | FileCheck --check-prefixes=CHECK,NO-NINF,NO-NNAN,NO-FINITE-ONLY %s
170 // RUN: %clang -### -ffinite-math-only -fhonor-infinities -c %s 2>&1 \
171 // RUN: | FileCheck --check-prefixes=CHECK,NO-NINF,NNAN,NO-FINITE-ONLY %s
172 // RUN: %clang -### -ffinite-math-only -fno-finite-math-only -c %s 2>&1 \
173 // RUN: | FileCheck --check-prefixes=CHECK,NO-NINF,NO-NNAN,NO-FINITE-ONLY %s
174 // RUN: %clang -### -ffast-math -fhonor-infinities -c %s 2>&1 \
175 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-NINF,NNAN,NO-FINITE-ONLY,REASSOC,NSZ,ARCP,AFN,CONTRACT-FAST,NO-ERRNO,NOROUNDING %s
176 // RUN: %clang -### -ffast-math -fno-finite-math-only -c %s 2>&1 \
177 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-NINF,NO-NNAN,NO-FINITE-ONLY,REASSOC,NSZ,ARCP,AFN,CONTRACT-FAST,NO-ERRNO,NOROUNDING %s
179 // RUN: %clang -### -fno-honor-nans -fhonor-nans -c %s 2>&1 \
180 // RUN: | FileCheck --check-prefixes=CHECK,NO-NINF,NO-NNAN,NO-FINITE-ONLY %s
181 // RUN: %clang -### -ffinite-math-only -fhonor-nans -c %s 2>&1 \
182 // RUN: | FileCheck --check-prefixes=CHECK,NINF,NO-NNAN,NO-FINITE-ONLY %s
183 // RUN: %clang -### -ffinite-math-only -fno-finite-math-only -c %s 2>&1 \
184 // RUN: | FileCheck --check-prefixes=CHECK,NO-NINF,NO-NNAN,NO-FINITE-ONLY %s
185 // RUN: %clang -### -ffast-math -fhonor-nans -c %s 2>&1 \
186 // RUN: | FileCheck --check-prefixes=CHECK,NINF,NO-NNAN,NO-FINITE-ONLY %s
187 // RUN: %clang -### -ffast-math -fno-finite-math-only -c %s 2>&1 \
188 // RUN: | FileCheck --check-prefixes=CHECK,NO-NINF,NO-NNAN,NO-FINITE-ONLY %s
190 // A later inverted option overrides an earlier option.
192 // RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \
193 // RUN: -fno-trapping-math -fno-associative-math -c %s 2>&1 \
194 // RUN: | FileCheck --check-prefixes=CHECK,NO-REASSOC,ARCP,NSZ,NO-TRAPPING %s
196 // RUN: %clang -### -funsafe-math-optimizations -fno-associative-math -c %s 2>&1 \
197 // RUN: | FileCheck --check-prefixes=CHECK,NO-UNSAFE,NO-REASSOC,ARCP,NSZ,AFN %s
199 // RUN: %clang -### -funsafe-math-optimizations -fno-reciprocal-math -c %s 2>&1 \
200 // RUN: | FileCheck --check-prefixes=CHECK,NO-UNSAFE,REASSOC,NO-ARCP,NSZ,AFN %s
202 // reassoc requires nsz
203 // RUN: %clang -### -funsafe-math-optimizations -fsigned-zeros -c %s 2>&1 \
204 // RUN: | FileCheck --check-prefixes=CHECK,NO-UNSAFE,NO-REASSOC,ARCP,NO-NSZ,AFN %s
206 // FIXME: Shouldn't trapping math disable all unsafe math?
207 // RUN: %clang -### -funsafe-math-optimizations -ftrapping-math -c %s 2>&1 \
208 // RUN: | FileCheck --check-prefixes=CHECK,NO-UNSAFE,ARCP,NSZ,AFN,TRAPPING %s
210 // RUN: %clang -### -funsafe-math-optimizations -fno-unsafe-math-optimizations \
211 // RUN: -c %s 2>&1 \
212 // RUN: | FileCheck --check-prefixes=CHECK,NO-UNSAFE,NO-REASSOC,NO-ARCP,NO-NSZ,NO-AFN,NO-TRAPPING %s
213 // RUN: %clang -### -ffast-math -fno-associative-math -c %s 2>&1 \
214 // RUN: | FileCheck --check-prefixes=CHECK,NO-UNSAFE,NO-REASSOC,ARCP,NSZ,AFN %s
216 // RUN: %clang -### -ffast-math -fno-reciprocal-math -c %s 2>&1 \
217 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-UNSAFE,NNAN,NINF,FINITE-ONLY,REASSOC,NO-ARCP,CONTRACT-FAST,NSZ,AFN %s
219 // reassoc requires nsz
220 // RUN: %clang -### -ffast-math -fsigned-zeros -c %s 2>&1 \
221 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-UNSAFE,NNAN,NINF,FINITE-ONLY,NO-REASSOC,ARCP,CONTRACT-FAST,NO-NSZ,AFN %s
223 // FIXME: Shouldn't trapping math disable unsafe math?
224 // RUN: %clang -### -ffast-math -ftrapping-math -c %s 2>&1 \
225 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-UNSAFE,ARCP,NSZ,AFN,TRAPPING %s
227 // RUN: %clang -### -ffast-math -fno-unsafe-math-optimizations -c %s 2>&1 \
228 // RUN: | FileCheck --check-prefixes=CHECK,NO-FAST,NO-UNSAFE,NO-ARCP,NO-NSZ,NO-AFN,NO-TRAPPING %s
230 // Reassociate is allowed because it does not require reciprocal-math.
232 // RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \
233 // RUN: -fno-trapping-math -fno-reciprocal-math -c %s 2>&1 \
234 // RUN: | FileCheck --check-prefixes=CHECK,REASSOC,NO-ARCP,NSZ,NO-TRAPPING %s
237 // In these runs, reassociate is not allowed because both no-signed-zeros and no-trapping-math are required.
239 // RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \
240 // RUN: -fno-trapping-math -fsigned-zeros -c %s 2>&1 \
241 // RUN: | FileCheck --check-prefixes=CHECK,NO-REASSOC,ARCP,NO-NSZ,NO-TRAPPING %s
243 // RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \
244 // RUN: -fno-trapping-math -ftrapping-math -c %s 2>&1 \
245 // RUN: | FileCheck --check-prefixes=CHECK,NO-REASSOC,ARCP,NSZ,TRAPPING %s
247 // The checks below allow stringing together prefixes to select the expected
248 // set of cc1 options for any combination of floating-point options.
249 // This is based on the assumption that the order of the flags when rendered
250 // is stable, so the negative checks only need to appear where the option would
251 // appear if used.
253 // start marker
254 // CHECK: "-cc1"
256 // NO-NINF-NOT: "-menable-no-infs"
257 // NINF-SAME: "-menable-no-infs"
259 // NO-NNAN-NOT: "-menable-no-nans"
260 // NNAN-SAME: "-menable-no-nans"
262 // NO-AFN-NOT: "-fapprox-func"
263 // AFN-SAME: "-fapprox-func"
265 // NO-ERRNO-NOT: "-fmath-errno"
266 // ERRNO-SAME: "-fmath-errno"
268 // NO-UNSAFE-NOT: "-funsafe-math-optimizations"
269 // UNSAFE-SAME: "-funsafe-math-optimizations"
271 // NO-NSZ-NOT: "-fno-signed-zeros"
272 // NSZ-SAME: "-fno-signed-zeros"
274 // NO-REASSOC-NOT: "-mreassociate"
275 // REASSOC-SAME: "-mreassociate"
277 // NO-ARCP-NOT: "-freciprocal-math"
278 // ARCP-SAME: "-freciprocal-math"
280 // NO-DENORM-NOT: "-fdenormal-fp-math"
281 // DENORM-IEEE-SAME: "-fdenormal-fp-math=ieee,ieee"
282 // DENORM-PS-SAME: "-fdenormal-fp-math=preserve-sign,preserve-sign"
283 // DENORM-PZ-SAME: "-fdenormal-fp-math=positive-zero,positive-zero"
285 // NO-CONTRACT-NOT: "-ffp-contract"
286 // CONTRACT-OFF-SAME: "-ffp-contract=off"
287 // CONTRACT-ON-SAME: "-ffp-contract=on"
288 // CONTRACT-FAST-SAME: "-ffp-contract=fast"
290 // This one is odd because -frounding-math is the default
291 // NO-NOROUNDING-NOT: "-fno-rounding-math"
292 // NOROUNDING-SAME: "-fno-rounding-math"
294 // NO-TRAPPING-NOT: "-ffp-exception-behavior=strict"
295 // NO-TRAPPING-NOT: "-ffp-exception-behavior=maytrap"
296 // TRAPPING-SAME: "-ffp-exception-behavior=strict"
298 // NO-FAST-NOT: "-ffast-math"
299 // FAST-SAME: "-ffast-math"
301 // NO-FINITE-ONLY-NOT: "-ffinite-math-only"
302 // FINITE-ONLY-SAME: "-ffinite-math-only"
304 // NO-CX-RANGE-NOT: "-complex-range"
305 // CX-RANGE-FULL-SAME: "-complex-range=full"
306 // CX-RANGE-PROMO-SAME: "-complex-range=promoted"
307 // CX-RANGE-IMPRO-SAME: "-complex-range=improved"
308 // CX-RANGE-BASIC-SAME: "-complex-range=basic"
310 // end marker
311 // CHECK-SAME: "-o"
314 // This isn't fast-math, but the option is handled in the same place as other FP params.
315 // Last option wins, and strict behavior is assumed by default.
317 // RUN: %clang -### -fno-strict-float-cast-overflow -c %s 2>&1 \
318 // RUN: | FileCheck --check-prefix=CHECK-FPOV-WORKAROUND %s
319 // CHECK-FPOV-WORKAROUND: "-cc1"
320 // CHECK-FPOV-WORKAROUND: "-fno-strict-float-cast-overflow"
322 // RUN: %clang -### -c %s 2>&1 \
323 // RUN: | FileCheck --check-prefix=CHECK-FPOV-WORKAROUND-DEFAULT %s
324 // CHECK-FPOV-WORKAROUND-DEFAULT: "-cc1"
325 // CHECK-FPOV-WORKAROUND-DEFAULT-NOT: "strict-float-cast-overflow"
327 // RUN: %clang -### -fstrict-float-cast-overflow -c %s 2>&1 \
328 // RUN: | FileCheck --check-prefix=CHECK-NO-FPOV-WORKAROUND %s
329 // CHECK-NO-FPOV-WORKAROUND: "-cc1"
330 // CHECK-NO-FPOV-WORKAROUND-NOT: "strict-float-cast-overflow"
332 // RUN: %clang -### -fno-strict-float-cast-overflow -fstrict-float-cast-overflow -c %s 2>&1 \
333 // RUN: | FileCheck --check-prefix=CHECK-NO-FPOV-WORKAROUND-OVERRIDE %s
334 // CHECK-NO-FPOV-WORKAROUND-OVERRIDE: "-cc1"
335 // CHECK-NO-FPOV-WORKAROUND-OVERRIDE-NOT: "strict-float-cast-overflow"