[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / Driver / fast-math.c
blob882e81fd14d34a7f352f35aae5abeed153611994
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-prefix=CHECK-NO-INFS %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-prefix=CHECK-NO-INFS %s
14 // CHECK-NO-INFS: "-cc1"
15 // CHECK-NO-INFS: "-menable-no-infs"
17 // RUN: %clang -### -fno-fast-math -fno-honor-infinities -c %s 2>&1 \
18 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-NO-INFS %s
19 // CHECK-NO-FAST-MATH-NO-INFS: "-cc1"
20 // CHECK-NO-FAST-MATH-NO-INFS: "-menable-no-infs"
22 // RUN: %clang -### -fno-honor-infinities -fno-fast-math -c %s 2>&1 \
23 // RUN: | FileCheck --check-prefix=CHECK-NO-INFS-NO-FAST-MATH %s
24 // CHECK-NO-INFS-NO-FAST-MATH: "-cc1"
25 // CHECK-NO-INFS-NO-FAST-MATH-NOT: "-menable-no-infs"
27 // RUN: %clang -### -fno-signed-zeros -c %s 2>&1 \
28 // RUN: | FileCheck --check-prefix=CHECK-NO-SIGNED-ZEROS %s
29 // CHECK-NO-SIGNED-ZEROS: "-cc1"
30 // CHECK-NO-SIGNED-ZEROS: "-fno-signed-zeros"
32 // RUN: %clang -### -fno-fast-math -fno-signed-zeros -c %s 2>&1 \
33 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-NO-SIGNED-ZEROS %s
34 // CHECK-NO-FAST-MATH-NO-SIGNED-ZEROS: "-cc1"
35 // CHECK-NO-FAST-MATH-NO-SIGNED-ZEROS: "-fno-signed-zeros"
37 // RUN: %clang -### -fno-signed-zeros -fno-fast-math -c %s 2>&1 \
38 // RUN: | FileCheck --check-prefix=CHECK-NO-SIGNED-ZEROS-NO-FAST-MATH %s
39 // CHECK-NO-SIGNED-ZEROS-NO-FAST-MATH: "-cc1"
40 // CHECK-NO-SIGNED-ZEROS-NO-FAST-MATH-NOT: "-fno-signed-zeros"
42 // RUN: %clang -### -freciprocal-math -c %s 2>&1 \
43 // RUN: | FileCheck --check-prefix=CHECK-RECIPROCAL-MATH %s
44 // CHECK-RECIPROCAL-MATH: "-cc1"
45 // CHECK-RECIPROCAL-MATH: "-freciprocal-math"
47 // RUN: %clang -### -fno-fast-math -freciprocal-math -c %s 2>&1 \
48 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-RECIPROCAL-MATH %s
49 // CHECK-NO-FAST-MATH-RECIPROCAL-MATH: "-cc1"
50 // CHECK-NO-FAST-MATH-RECIPROCAL-MATH: "-freciprocal-math"
52 // RUN: %clang -### -freciprocal-math -fno-fast-math -c %s 2>&1 \
53 // RUN: | FileCheck --check-prefix=CHECK-RECIPROCAL-MATH-NO-FAST-MATH %s
54 // CHECK-RECIPROCAL-MATH-NO-FAST-MATH: "-cc1"
55 // CHECK-RECIPROCAL-MATH-NO-FAST-MATH-NOT: "-freciprocal-math"
57 // RUN: %clang -### -fno-honor-nans -c %s 2>&1 \
58 // RUN: | FileCheck --check-prefix=CHECK-NO-NANS %s
59 // CHECK-NO-NANS: "-cc1"
60 // CHECK-NO-NANS: "-menable-no-nans"
62 // RUN: %clang -### -fno-fast-math -fno-honor-nans -c %s 2>&1 \
63 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-NO-NANS %s
64 // CHECK-NO-FAST-MATH-NO-NANS: "-cc1"
65 // CHECK-NO-FAST-MATH-NO-NANS: "-menable-no-nans"
67 // RUN: %clang -### -fno-honor-nans -fno-fast-math -c %s 2>&1 \
68 // RUN: | FileCheck --check-prefix=CHECK-NO-NANS-NO-FAST-MATH %s
69 // CHECK-NO-NANS-NO-FAST-MATH: "-cc1"
70 // CHECK-NO-NANS-NO-FAST-MATH-NOT: "-menable-no-nans"
72 // RUN: %clang -### -ffast-math -fno-approx-func -c %s 2>&1 \
73 // RUN: | FileCheck --check-prefix=CHECK-FAST-MATH-NO-APPROX-FUNC %s
74 // CHECK-FAST-MATH-NO-APPROX-FUNC: "-cc1"
75 // CHECK-FAST-MATH-NO-APPROX-FUNC: "-menable-no-infs"
76 // CHECK-FAST-MATH-NO-APPROX-FUNC: "-menable-no-nans"
77 // CHECK-FAST-MATH-NO-APPROX-FUNC: "-fno-signed-zeros"
78 // CHECK-FAST-MATH-NO-APPROX-FUNC: "-mreassociate"
79 // CHECK-FAST-MATH-NO-APPROX-FUNC: "-freciprocal-math"
80 // CHECK-FAST-MATH-NO-APPROX-FUNC: "-ffp-contract=fast"
81 // CHECK-FAST-MATH-NO-APPROX-FUNC-NOT: "-ffast-math"
82 // CHECK-FAST-MATH-NO-APPROX-FUNC-NOT: "-fapprox-func"
84 // RUN: %clang -### -fno-approx-func -ffast-math -c %s 2>&1 \
85 // RUN: | FileCheck --check-prefix=CHECK-NO-APPROX-FUNC-FAST-MATH %s
86 // CHECK-NO-APPROX-FUNC-FAST-MATH: "-cc1"
87 // CHECK-NO-APPROX-FUNC-FAST-MATH: "-ffast-math"
89 // RUN: %clang -### -fapprox-func -c %s 2>&1 \
90 // RUN: | FileCheck --check-prefix=CHECK-APPROX-FUNC %s
91 // CHECK-APPROX-FUNC: "-cc1"
92 // CHECK-APPROX-FUNC: "-fapprox-func"
94 // RUN: %clang -### -fno-fast-math -fapprox-func -c %s 2>&1 \
95 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-APPROX-FUNC %s
96 // CHECK-NO-FAST-MATH-APPROX-FUNC: "-cc1"
97 // CHECK-NO-FAST-MATH-APPROX-FUNC: "-fapprox-func"
99 // RUN: %clang -### -fapprox-func -fno-fast-math -c %s 2>&1 \
100 // RUN: | FileCheck --check-prefix=CHECK-APPROX-FUNC-NO-FAST-MATH %s
101 // CHECK-APPROX-FUNC-NO-FAST-MATH: "-cc1"
102 // CHECK-APPROX-FUNC-NO-FAST-MATH-NOT: "-fapprox-func"
104 // RUN: %clang -### -fmath-errno -c %s 2>&1 \
105 // RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
106 // CHECK-MATH-ERRNO: "-cc1"
107 // CHECK-MATH-ERRNO: "-fmath-errno"
109 // RUN: %clang -### -fmath-errno -fno-math-errno -c %s 2>&1 \
110 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
111 // CHECK-NO-MATH-ERRNO: "-cc1"
112 // CHECK-NO-MATH-ERRNO-NOT: "-fmath-errno"
114 // Target defaults for -fmath-errno (reusing the above checks).
115 // RUN: %clang -### -target i686-unknown-linux -c %s 2>&1 \
116 // RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
117 // RUN: %clang -### -target i686-apple-darwin -c %s 2>&1 \
118 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
119 // RUN: %clang -### -target x86_64-unknown-freebsd -c %s 2>&1 \
120 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
121 // RUN: %clang -### -target x86_64-unknown-netbsd -c %s 2>&1 \
122 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
123 // RUN: %clang -### -target x86_64-unknown-openbsd -c %s 2>&1 \
124 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
125 // RUN: %clang -### --target=x86_64-unknown-haiku -c %s 2>&1 \
126 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
127 // RUN: %clang -### -target x86_64-unknown-dragonfly -c %s 2>&1 \
128 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
129 // RUN: %clang -### -target x86_64-fuchsia -c %s 2>&1 \
130 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
131 // RUN: %clang -### -target x86_64-linux-android -c %s 2>&1 \
132 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
133 // RUN: %clang -### -target x86_64-linux-musl -c %s 2>&1 \
134 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
135 // RUN: %clang -### --target=amdgcn-amd-amdhsa -nogpuinc -nogpulib -c %s 2>&1 \
136 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
137 // RUN: %clang -### -target amdgcn-amd-amdpal -c %s 2>&1 \
138 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
139 // RUN: %clang -### -target amdgcn-mesa-mesa3d -c %s 2>&1 \
140 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
142 // Check that -ffast-math disables -fmath-errno, and -fno-fast-math merely
143 // preserves the target default. Also check various flag set operations between
144 // the two flags. (Resuses above checks.)
145 // RUN: %clang -### -ffast-math -c %s 2>&1 \
146 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
147 // RUN: %clang -### -fmath-errno -ffast-math -c %s 2>&1 \
148 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
149 // RUN: %clang -### -ffast-math -fmath-errno -c %s 2>&1 \
150 // RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
151 // RUN: %clang -### -target i686-unknown-linux -fno-fast-math -c %s 2>&1 \
152 // RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
153 // RUN: %clang -### -target i686-unknown-linux -fno-math-errno -fno-fast-math -c %s 2>&1 \
154 // RUN: | FileCheck --check-prefix=CHECK-MATH-ERRNO %s
155 // RUN: %clang -### -target i686-apple-darwin -fno-fast-math -c %s 2>&1 \
156 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
157 // RUN: %clang -### -target i686-apple-darwin -fno-math-errno -fno-fast-math -c %s 2>&1 \
158 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
159 // RUN: %clang -### -fno-fast-math -fno-math-errno -c %s 2>&1 \
160 // RUN: | FileCheck --check-prefix=CHECK-NO-MATH-ERRNO %s
162 // RUN: %clang -### -fno-math-errno -fassociative-math -freciprocal-math \
163 // RUN: -fno-signed-zeros -fno-trapping-math -fapprox-func -c %s 2>&1 \
164 // RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s
165 // CHECK-UNSAFE-MATH: "-cc1"
166 // CHECK-UNSAFE-MATH: "-funsafe-math-optimizations"
167 // CHECK-UNSAFE-MATH: "-mreassociate"
169 // RUN: %clang -### -fno-fast-math -fno-math-errno -fassociative-math -freciprocal-math \
170 // RUN: -fno-signed-zeros -fno-trapping-math -fapprox-func -c %s 2>&1 \
171 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH-UNSAFE-MATH %s
172 // CHECK-NO-FAST-MATH-UNSAFE-MATH: "-cc1"
173 // CHECK-NO-FAST-MATH-UNSAFE-MATH: "-funsafe-math-optimizations"
174 // CHECK-NO-FAST-MATH-UNSAFE-MATH: "-mreassociate"
176 // The 2nd -fno-fast-math overrides -fassociative-math.
178 // RUN: %clang -### -fno-fast-math -fno-math-errno -fassociative-math -freciprocal-math \
179 // RUN: -fno-fast-math -fno-signed-zeros -fno-trapping-math -c %s 2>&1 \
180 // RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH-NO-FAST-MATH %s
181 // CHECK-UNSAFE-MATH-NO-FAST-MATH: "-cc1"
182 // CHECK-UNSAFE-MATH-NO-FAST-MATH-NOT: "-funsafe-math-optimizations"
183 // CHECK-UNSAFE-MATH-NO-FAST-MATH-NOT: "-mreassociate"
185 // Check that various umbrella flags also enable these frontend options.
186 // RUN: %clang -### -ffast-math -c %s 2>&1 \
187 // RUN: | FileCheck --check-prefix=CHECK-NO-INFS %s
188 // RUN: %clang -### -ffast-math -c %s 2>&1 \
189 // RUN: | FileCheck --check-prefix=CHECK-NO-NANS %s
190 // RUN: %clang -### -ffast-math -c %s 2>&1 \
191 // RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s
192 // RUN: %clang -### -ffinite-math-only -c %s 2>&1 \
193 // RUN: | FileCheck --check-prefix=CHECK-NO-INFS %s
194 // RUN: %clang -### -ffinite-math-only -c %s 2>&1 \
195 // RUN: | FileCheck --check-prefix=CHECK-NO-NANS %s
196 // RUN: %clang -### -funsafe-math-optimizations -fno-math-errno -c %s 2>&1 \
197 // RUN: | FileCheck --check-prefix=CHECK-UNSAFE-MATH %s
199 // One umbrella flag is *really* weird and also changes the semantics of the
200 // program by adding a special preprocessor macro. Check that the frontend flag
201 // modeling this semantic change is provided. Also check that the flag is not
202 // present if any of the optimizations are disabled.
203 // RUN: %clang -### -ffast-math -c %s 2>&1 \
204 // RUN: | FileCheck --check-prefix=CHECK-FAST-MATH %s
205 // RUN: %clang -### -fno-fast-math -ffast-math -c %s 2>&1 \
206 // RUN: | FileCheck --check-prefix=CHECK-FAST-MATH %s
207 // RUN: %clang -### -funsafe-math-optimizations -ffinite-math-only \
208 // RUN: -fno-math-errno -ffp-contract=fast -fno-rounding-math -c %s 2>&1 \
209 // RUN: | FileCheck --check-prefix=CHECK-FAST-MATH %s
210 // RUN: %clang -### -fno-honor-infinities -fno-honor-nans -fno-math-errno \
211 // RUN: -fassociative-math -freciprocal-math -fno-signed-zeros -fapprox-func \
212 // RUN: -fno-trapping-math -ffp-contract=fast -fno-rounding-math -c %s 2>&1 \
213 // RUN: | FileCheck --check-prefix=CHECK-FAST-MATH %s
214 // CHECK-FAST-MATH: "-cc1"
215 // CHECK-FAST-MATH: "-ffast-math"
216 // CHECK-FAST-MATH: "-ffinite-math-only"
218 // RUN: %clang -### -ffast-math -fno-fast-math -c %s 2>&1 \
219 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH %s
220 // RUN: %clang -### -ffast-math -fno-finite-math-only -c %s 2>&1 \
221 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH %s
222 // RUN: %clang -### -ffast-math -fno-unsafe-math-optimizations -c %s 2>&1 \
223 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH %s
224 // RUN: %clang -### -ffast-math -fmath-errno -c %s 2>&1 \
225 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH %s
226 // RUN: %clang -### -ffast-math -fno-associative-math -c %s 2>&1 \
227 // RUN: | FileCheck --check-prefix=CHECK-NO-FAST-MATH --check-prefix=CHECK-ASSOC-MATH %s
228 // CHECK-NO-FAST-MATH: "-cc1"
229 // CHECK-NO-FAST-MATH-NOT: "-ffast-math"
230 // CHECK-ASSOC-MATH-NOT: "-mreassociate"
232 // Check various means of disabling these flags, including disabling them after
233 // they've been enabled via an umbrella flag.
234 // RUN: %clang -### -fno-honor-infinities -fhonor-infinities -c %s 2>&1 \
235 // RUN: | FileCheck --check-prefix=CHECK-NO-NO-INFS %s
236 // RUN: %clang -### -ffinite-math-only -fhonor-infinities -c %s 2>&1 \
237 // RUN: | FileCheck --check-prefix=CHECK-NO-NO-INFS %s
238 // RUN: %clang -### -ffinite-math-only -fno-finite-math-only -c %s 2>&1 \
239 // RUN: | FileCheck --check-prefix=CHECK-NO-NO-INFS %s
240 // RUN: %clang -### -ffast-math -fhonor-infinities -c %s 2>&1 \
241 // RUN: | FileCheck --check-prefix=CHECK-NO-NO-INFS %s
242 // RUN: %clang -### -ffast-math -fno-finite-math-only -c %s 2>&1 \
243 // RUN: | FileCheck --check-prefix=CHECK-NO-NO-INFS %s
244 // CHECK-NO-NO-INFS: "-cc1"
245 // CHECK-NO-NO-INFS-NOT: "-menable-no-infs"
246 // CHECK-NO-NO-INFS-NOT: "-ffinite-math-only"
247 // CHECK-NO-NO-INFS: "-o"
249 // RUN: %clang -### -fno-honor-nans -fhonor-nans -c %s 2>&1 \
250 // RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s
251 // RUN: %clang -### -ffinite-math-only -fhonor-nans -c %s 2>&1 \
252 // RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s
253 // RUN: %clang -### -ffinite-math-only -fno-finite-math-only -c %s 2>&1 \
254 // RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s
255 // RUN: %clang -### -ffast-math -fhonor-nans -c %s 2>&1 \
256 // RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s
257 // RUN: %clang -### -ffast-math -fno-finite-math-only -c %s 2>&1 \
258 // RUN: | FileCheck --check-prefix=CHECK-NO-NO-NANS %s
259 // CHECK-NO-NO-NANS: "-cc1"
260 // CHECK-NO-NO-NANS-NOT: "-menable-no-nans"
261 // CHECK-NO-NO-NANS-NOT: "-ffinite-math-only"
262 // CHECK-NO-NO-NANS: "-o"
264 // A later inverted option overrides an earlier option.
266 // RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \
267 // RUN: -fno-trapping-math -fno-associative-math -c %s 2>&1 \
268 // RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
270 // RUN: %clang -### -funsafe-math-optimizations -fno-associative-math -c %s \
271 // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
273 // RUN: %clang -### -funsafe-math-optimizations -fno-reciprocal-math -c %s \
274 // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
275 // RUN: %clang -### -funsafe-math-optimizations -fsigned-zeros -c %s 2>&1 \
276 // RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
277 // RUN: %clang -### -funsafe-math-optimizations -ftrapping-math -c %s 2>&1 \
278 // RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
279 // RUN: %clang -### -funsafe-math-optimizations -fno-unsafe-math-optimizations \
280 // RUN: -c %s 2>&1 \
281 // RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
282 // RUN: %clang -### -ffast-math -fno-associative-math -c %s 2>&1 \
283 // RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
285 // RUN: %clang -### -ffast-math -fno-reciprocal-math -c %s 2>&1 \
286 // RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
287 // RUN: %clang -### -ffast-math -fsigned-zeros -c %s 2>&1 \
288 // RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
289 // RUN: %clang -### -ffast-math -ftrapping-math -c %s 2>&1 \
290 // RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
291 // RUN: %clang -### -ffast-math -fno-unsafe-math-optimizations -c %s 2>&1 \
292 // RUN: | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
294 // CHECK-NO-UNSAFE-MATH: "-cc1"
295 // CHECK-NO-UNSAFE-MATH-NOT: "-funsafe-math-optimizations"
296 // CHECK-NO_UNSAFE-MATH-NOT: "-mreassociate"
297 // CHECK-NO-UNSAFE-MATH: "-o"
300 // Reassociate is allowed because it does not require reciprocal-math.
302 // RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \
303 // RUN: -fno-trapping-math -fno-reciprocal-math -c %s 2>&1 \
304 // RUN: | FileCheck --check-prefix=CHECK-REASSOC-NO-UNSAFE-MATH %s
306 // CHECK-REASSOC-NO-UNSAFE-MATH: "-cc1"
307 // CHECK-REASSOC-NO_UNSAFE-MATH-NOT: "-funsafe-math-optimizations"
308 // CHECK-REASSOC-NO_UNSAFE-MATH: "-mreassociate"
309 // CHECK-REASSOC-NO-UNSAFE-MATH-NOT: "-funsafe-math-optimizations"
310 // CHECK-REASSOC-NO-UNSAFE-MATH: "-o"
313 // In these runs, reassociate is not allowed because both no-signed-zeros and no-trapping-math are required.
315 // RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \
316 // RUN: -fno-trapping-math -fsigned-zeros -c %s 2>&1 \
317 // RUN: | FileCheck --check-prefix=CHECK-NO-REASSOC-NO-UNSAFE-MATH %s
319 // RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \
320 // RUN: -fno-trapping-math -ftrapping-math -c %s 2>&1 \
321 // RUN: | FileCheck --check-prefix=CHECK-NO-REASSOC-NO-UNSAFE-MATH %s
323 // CHECK-NO-REASSOC-NO-UNSAFE-MATH: "-cc1"
324 // CHECK-NO-REASSOC-NO_UNSAFE-MATH-NOT: "-funsafe-math-optimizations"
325 // CHECK-NO-REASSOC-NO_UNSAFE-MATH-NOT: "-mreassociate"
326 // CHECK-NO-REASSOC-NO_UNSAFE-MATH-NOT: "-funsafe-math-optimizations"
327 // CHECK-NO-REASSOC-NO-UNSAFE-MATH: "-o"
330 // This isn't fast-math, but the option is handled in the same place as other FP params.
331 // Last option wins, and strict behavior is assumed by default.
333 // RUN: %clang -### -fno-strict-float-cast-overflow -c %s 2>&1 \
334 // RUN: | FileCheck --check-prefix=CHECK-FPOV-WORKAROUND %s
335 // CHECK-FPOV-WORKAROUND: "-cc1"
336 // CHECK-FPOV-WORKAROUND: "-fno-strict-float-cast-overflow"
338 // RUN: %clang -### -c %s 2>&1 \
339 // RUN: | FileCheck --check-prefix=CHECK-FPOV-WORKAROUND-DEFAULT %s
340 // CHECK-FPOV-WORKAROUND-DEFAULT: "-cc1"
341 // CHECK-FPOV-WORKAROUND-DEFAULT-NOT: "strict-float-cast-overflow"
343 // RUN: %clang -### -fstrict-float-cast-overflow -c %s 2>&1 \
344 // RUN: | FileCheck --check-prefix=CHECK-NO-FPOV-WORKAROUND %s
345 // CHECK-NO-FPOV-WORKAROUND: "-cc1"
346 // CHECK-NO-FPOV-WORKAROUND-NOT: "strict-float-cast-overflow"
348 // RUN: %clang -### -fno-strict-float-cast-overflow -fstrict-float-cast-overflow -c %s 2>&1 \
349 // RUN: | FileCheck --check-prefix=CHECK-NO-FPOV-WORKAROUND-OVERRIDE %s
350 // CHECK-NO-FPOV-WORKAROUND-OVERRIDE: "-cc1"
351 // CHECK-NO-FPOV-WORKAROUND-OVERRIDE-NOT: "strict-float-cast-overflow"