|
2 | 2 | // the options -ffast-math, -fno-fast-math, funsafe-math-optimizations,
|
3 | 3 | // fno-unsafe-math-optimizations.
|
4 | 4 |
|
| 5 | +// These warning checks are above the run lines because the warning is reported |
| 6 | +// before the drive options that are checked below the run lines. |
| 7 | +// WARN_FM_OFF: warning: overriding '-ffast-math' option with '-ffp-contract=off' |
| 8 | +// WARN_FM_ON: warning: overriding '-ffast-math' option with '-ffp-contract=on' |
| 9 | +// WARN_FM_FHP: warning: overriding '-ffast-math' option with '-ffp-contract=fast-honor-pragmas' |
| 10 | +// WARN_UM_OFF: warning: overriding '-funsafe-math-optimizations' option with '-ffp-contract=off' |
| 11 | +// WARN_UM_ON: warning: overriding '-funsafe-math-optimizations' option with '-ffp-contract=on' |
| 12 | + |
5 | 13 | // ffast-math, fno-fast-math
|
6 | 14 | // RUN: %clang -### -ffast-math -c %s 2>&1 \
|
7 | 15 | // RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
|
|
10 | 18 | // RUN: %clang -### -fno-fast-math -c %s 2>&1 \
|
11 | 19 | // RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
|
12 | 20 |
|
13 |
| -// RUN: %clang -### -Werror -ffast-math -ffp-contract=on -c %s 2>&1 \ |
14 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s |
| 21 | +// RUN: %clang -### -ffast-math -ffp-contract=on -c %s 2>&1 \ |
| 22 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_FM_ON %s |
15 | 23 | // CHECK-FPC-ON: "-ffp-contract=on"
|
16 | 24 |
|
17 |
| -// RUN: %clang -### -Werror -ffast-math -ffp-contract=off -c %s 2>&1 \ |
18 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s |
| 25 | +// RUN: %clang -### -ffast-math -ffp-contract=off -c %s 2>&1 \ |
| 26 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_FM_OFF %s |
19 | 27 | // CHECK-FPC-OFF: "-ffp-contract=off"
|
20 | 28 |
|
21 | 29 | // RUN: %clang -### -Werror -ffast-math -ffp-contract=fast -c %s 2>&1 \
|
22 | 30 | // RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
|
23 | 31 |
|
24 |
| -// RUN: %clang -### -Werror -ffast-math -ffp-contract=fast-honor-pragmas -c %s 2>&1 \ |
25 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST-HONOR %s |
| 32 | +// RUN: %clang -### -ffast-math -ffp-contract=fast-honor-pragmas -c %s 2>&1 \ |
| 33 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-FAST-HONOR,WARN_FM_FHP %s |
26 | 34 | // CHECK-FPC-FAST-HONOR: "-ffp-contract=fast-honor-pragmas"
|
27 | 35 |
|
28 | 36 | // RUN: %clang -### -Werror -ffp-contract=fast -ffast-math -c %s 2>&1 \
|
|
43 | 51 | // RUN: %clang -### -Werror -ffast-math -ffp-contract=fast -ffp-contract=on -c %s 2>&1 \
|
44 | 52 | // RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
|
45 | 53 |
|
46 |
| -// RUN: %clang -### -Werror -ffast-math -ffp-contract=on -ffp-contract=off -c %s 2>&1 \ |
47 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s |
| 54 | +// RUN: %clang -### -ffast-math -ffp-contract=on -ffp-contract=off -c %s 2>&1 \ |
| 55 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_FM_ON %s |
48 | 56 |
|
49 |
| -// RUN: %clang -### -Werror -ffast-math -ffp-contract=on -ffp-contract=fast -c %s 2>&1 \ |
50 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s |
| 57 | +// RUN: %clang -### -ffast-math -ffp-contract=on -ffp-contract=fast -c %s 2>&1 \ |
| 58 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-FAST,WARN_FM_ON %s |
51 | 59 |
|
52 |
| -// RUN: %clang -### -Werror -ffast-math -ffp-contract=off -ffp-contract=on -c %s 2>&1 \ |
53 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s |
| 60 | +// RUN: %clang -### -ffast-math -ffp-contract=off -ffp-contract=on -c %s 2>&1 \ |
| 61 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_FM_OFF %s |
54 | 62 |
|
55 |
| -// RUN: %clang -### -Werror -ffast-math -ffp-contract=off -ffp-contract=fast \ |
56 |
| -// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s |
| 63 | +// RUN: %clang -### -ffast-math -ffp-contract=off -ffp-contract=fast \ |
| 64 | +// RUN: -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-FAST,WARN_FM_OFF %s |
57 | 65 |
|
58 |
| -// RUN: %clang -### -Werror -ffast-math -ffp-contract=on -fno-fast-math -c %s 2>&1 \ |
59 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s |
| 66 | +// RUN: %clang -### -ffast-math -ffp-contract=on -fno-fast-math -c %s 2>&1 \ |
| 67 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_FM_ON %s |
60 | 68 |
|
61 |
| -// RUN: %clang -### -Werror -ffast-math -ffp-contract=off -fno-fast-math -c %s 2>&1 \ |
62 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s |
| 69 | +// RUN: %clang -### -ffast-math -ffp-contract=off -fno-fast-math -c %s 2>&1 \ |
| 70 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_FM_OFF %s |
63 | 71 |
|
64 | 72 | // RUN: %clang -### -Werror -ffast-math -ffp-contract=fast -fno-fast-math -c %s 2>&1 \
|
65 | 73 | // RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
|
|
112 | 120 | // RUN: %clang -### -Werror -fno-fast-math -ffast-math -ffp-contract=fast \
|
113 | 121 | // RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s
|
114 | 122 |
|
115 |
| -// RUN: %clang -### -Werror -fno-fast-math -ffast-math -ffp-contract=on \ |
116 |
| -// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s |
| 123 | +// RUN: %clang -### -fno-fast-math -ffast-math -ffp-contract=on \ |
| 124 | +// RUN: -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_FM_ON %s |
117 | 125 |
|
118 |
| -// RUN: %clang -### -Werror -fno-fast-math -ffast-math -ffp-contract=off \ |
119 |
| -// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF %s |
| 126 | +// RUN: %clang -### -fno-fast-math -ffast-math -ffp-contract=off \ |
| 127 | +// RUN: -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_FM_OFF %s |
120 | 128 |
|
121 | 129 | // funsafe-math-optimizations, fno-unsafe-math-optimizations
|
122 |
| -// RUN: %clang -### -funsafe-math-optimizations -c %s 2>&1 \ |
| 130 | +// RUN: %clang -### -Werror -funsafe-math-optimizations -c %s 2>&1 \ |
123 | 131 | // RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
|
124 | 132 |
|
125 |
| -// RUN: %clang -### -fno-unsafe-math-optimizations -c %s 2>&1 \ |
| 133 | +// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -c %s 2>&1 \ |
126 | 134 | // RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
|
127 | 135 |
|
128 |
| -// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=on -c %s 2>&1 \ |
129 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s |
| 136 | +// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on -c %s 2>&1 \ |
| 137 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_UM_ON %s |
130 | 138 |
|
131 |
| -// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \ |
132 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s |
| 139 | +// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \ |
| 140 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_UM_OFF %s |
133 | 141 |
|
134 | 142 | // RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=fast -c %s 2>&1 \
|
135 | 143 | // RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
|
|
151 | 159 | // RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=fast \
|
152 | 160 | // RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s
|
153 | 161 |
|
154 |
| -// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=on \ |
155 |
| -// RUN: -ffp-contract=off -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF %s |
| 162 | +// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on \ |
| 163 | +// RUN: -ffp-contract=off -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_UM_ON %s |
156 | 164 |
|
157 |
| -// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=on \ |
| 165 | +// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on \ |
158 | 166 | // RUN: -ffp-contract=fast -c %s 2>&1 \
|
159 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s |
| 167 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-FAST,WARN_UM_ON %s |
160 | 168 |
|
161 |
| -// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=off \ |
162 |
| -// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s |
| 169 | +// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off \ |
| 170 | +// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_UM_OFF %s |
163 | 171 |
|
164 |
| -// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=off \ |
| 172 | +// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off \ |
165 | 173 | // RUN: -ffp-contract=fast \
|
166 |
| -// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s |
| 174 | +// RUN: -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-FAST,WARN_UM_OFF %s |
167 | 175 |
|
168 |
| -// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=on \ |
| 176 | +// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on \ |
169 | 177 | // RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \
|
170 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s |
| 178 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_UM_ON %s |
171 | 179 |
|
172 |
| -// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=off \ |
| 180 | +// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off \ |
173 | 181 | // RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \
|
174 |
| -// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s |
| 182 | +// RUN: | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_UM_OFF %s |
175 | 183 |
|
176 | 184 | // RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=fast \
|
177 | 185 | // RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \
|
|
229 | 237 | // RUN: -ffp-contract=fast \
|
230 | 238 | // RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s
|
231 | 239 |
|
232 |
| -// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -funsafe-math-optimizations \ |
233 |
| -// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s |
| 240 | +// RUN: %clang -### -fno-unsafe-math-optimizations -funsafe-math-optimizations \ |
| 241 | +// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-ON,WARN_UM_ON %s |
234 | 242 |
|
235 |
| -// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -funsafe-math-optimizations \ |
236 |
| -// RUN: -ffp-contract=off -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF %s |
| 243 | +// RUN: %clang -### -fno-unsafe-math-optimizations -funsafe-math-optimizations \ |
| 244 | +// RUN: -ffp-contract=off -c %s 2>&1 | FileCheck --check-prefixes=CHECK-FPC-OFF,WARN_UM_OFF %s |
| 245 | + |
| 246 | +// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \ |
| 247 | +// RUN: | FileCheck --check-prefix=WARN_UM_OFF %s |
| 248 | + |
| 249 | +// This case should not warn |
| 250 | +// RUN: %clang -### -Werror -funsafe-math-optimizations \ |
| 251 | +// RUN: -fno-unsafe-math-optimizations -ffp-contract=off -c %s |
| 252 | + |
| 253 | +// RUN: %clang -### -ffast-math -ffp-contract=off -c %s 2>&1 \ |
| 254 | +// RUN: | FileCheck --check-prefix=WARN_FM_OFF %s |
237 | 255 |
|
| 256 | +// This case should not warn |
| 257 | +// RUN: %clang -### -Werror -ffast-math -fno-fast-math -ffp-contract=off -c %s |
0 commit comments