Skip to content

Commit 514d80b

Browse files
committed
[Driver,test] Add -Werror to -ffp-contract/-ffp-model tests
Test that these combinations do not lead to a warning. -funsafe-math-optimizations -ffp-contract=off and -ffast-math -ffp-contract=off may issue a warning after #91271.
1 parent 842f7b0 commit 514d80b

File tree

2 files changed

+77
-80
lines changed

2 files changed

+77
-80
lines changed

clang/test/Driver/fp-contract.c

Lines changed: 74 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -10,112 +10,112 @@
1010
// RUN: %clang -### -fno-fast-math -c %s 2>&1 \
1111
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
1212

13-
// RUN: %clang -### -ffast-math -ffp-contract=on -c %s 2>&1 \
13+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=on -c %s 2>&1 \
1414
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
1515
// CHECK-FPC-ON: "-ffp-contract=on"
1616

17-
// RUN: %clang -### -ffast-math -ffp-contract=off -c %s 2>&1 \
17+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=off -c %s 2>&1 \
1818
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
1919
// CHECK-FPC-OFF: "-ffp-contract=off"
2020

21-
// RUN: %clang -### -ffast-math -ffp-contract=fast -c %s 2>&1 \
21+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=fast -c %s 2>&1 \
2222
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
2323

24-
// RUN: %clang -### -ffast-math -ffp-contract=fast-honor-pragmas -c %s 2>&1 \
24+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=fast-honor-pragmas -c %s 2>&1 \
2525
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST-HONOR %s
2626
// CHECK-FPC-FAST-HONOR: "-ffp-contract=fast-honor-pragmas"
2727

28-
// RUN: %clang -### -ffp-contract=fast -ffast-math -c %s 2>&1 \
28+
// RUN: %clang -### -Werror -ffp-contract=fast -ffast-math -c %s 2>&1 \
2929
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
30-
// RUN: %clang -### -ffp-contract=on -ffast-math -c %s 2>&1 \
30+
// RUN: %clang -### -Werror -ffp-contract=on -ffast-math -c %s 2>&1 \
3131
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
32-
// RUN: %clang -### -ffp-contract=off -ffast-math -c %s 2>&1 \
32+
// RUN: %clang -### -Werror -ffp-contract=off -ffast-math -c %s 2>&1 \
3333
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
3434

35-
// RUN: %clang -### -ffp-contract=fast -fno-fast-math -c %s 2>&1 \
35+
// RUN: %clang -### -Werror -ffp-contract=fast -fno-fast-math -c %s 2>&1 \
3636
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
37-
// RUN: %clang -### -ffp-contract=on -fno-fast-math -c %s 2>&1 \
37+
// RUN: %clang -### -Werror -ffp-contract=on -fno-fast-math -c %s 2>&1 \
3838
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
39-
// RUN: %clang -### -ffp-contract=off -fno-fast-math -c %s 2>&1 \
39+
// RUN: %clang -### -Werror -ffp-contract=off -fno-fast-math -c %s 2>&1 \
4040
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
4141

4242

43-
// RUN: %clang -### -ffast-math -ffp-contract=fast -ffp-contract=on -c %s 2>&1 \
43+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=fast -ffp-contract=on -c %s 2>&1 \
4444
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
4545

46-
// RUN: %clang -### -ffast-math -ffp-contract=on -ffp-contract=off -c %s 2>&1 \
46+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=on -ffp-contract=off -c %s 2>&1 \
4747
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
4848

49-
// RUN: %clang -### -ffast-math -ffp-contract=on -ffp-contract=fast -c %s 2>&1 \
49+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=on -ffp-contract=fast -c %s 2>&1 \
5050
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
5151

52-
// RUN: %clang -### -ffast-math -ffp-contract=off -ffp-contract=on -c %s 2>&1 \
52+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=off -ffp-contract=on -c %s 2>&1 \
5353
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
5454

55-
// RUN: %clang -### -ffast-math -ffp-contract=off -ffp-contract=fast \
55+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=off -ffp-contract=fast \
5656
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s
5757

58-
// RUN: %clang -### -ffast-math -ffp-contract=on -fno-fast-math -c %s 2>&1 \
58+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=on -fno-fast-math -c %s 2>&1 \
5959
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
6060

61-
// RUN: %clang -### -ffast-math -ffp-contract=off -fno-fast-math -c %s 2>&1 \
61+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=off -fno-fast-math -c %s 2>&1 \
6262
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
6363

64-
// RUN: %clang -### -ffast-math -ffp-contract=fast -fno-fast-math -c %s 2>&1 \
64+
// RUN: %clang -### -Werror -ffast-math -ffp-contract=fast -fno-fast-math -c %s 2>&1 \
6565
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
6666

67-
// RUN: %clang -### -ffast-math -fno-fast-math -c %s 2>&1 \
67+
// RUN: %clang -### -Werror -ffast-math -fno-fast-math -c %s 2>&1 \
6868
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
6969

70-
// RUN: %clang -### -fno-fast-math -ffast-math -c %s 2>&1 \
70+
// RUN: %clang -### -Werror -fno-fast-math -ffast-math -c %s 2>&1 \
7171
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
7272

73-
// RUN: %clang -### -fno-fast-math -ffp-contract=on -c %s 2>&1 \
73+
// RUN: %clang -### -Werror -fno-fast-math -ffp-contract=on -c %s 2>&1 \
7474
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
7575

76-
// RUN: %clang -### -fno-fast-math -ffp-contract=off -c %s 2>&1 \
76+
// RUN: %clang -### -Werror -fno-fast-math -ffp-contract=off -c %s 2>&1 \
7777
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
7878

79-
// RUN: %clang -### -fno-fast-math -ffp-contract=fast -c %s 2>&1 \
79+
// RUN: %clang -### -Werror -fno-fast-math -ffp-contract=fast -c %s 2>&1 \
8080
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
8181

82-
// RUN: %clang -### -ffp-contract=fast -fno-fast-math -ffp-contract=on \
82+
// RUN: %clang -### -Werror -ffp-contract=fast -fno-fast-math -ffp-contract=on \
8383
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s
8484

85-
// RUN: %clang -### -ffp-contract=fast -fno-fast-math -ffp-contract=off \
85+
// RUN: %clang -### -Werror -ffp-contract=fast -fno-fast-math -ffp-contract=off \
8686
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF %s
8787

88-
// RUN: %clang -### -ffp-contract=off -fno-fast-math -ffp-contract=fast \
88+
// RUN: %clang -### -Werror -ffp-contract=off -fno-fast-math -ffp-contract=fast \
8989
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s
9090

91-
// RUN: %clang -### -ffp-contract=off -fno-fast-math -ffp-contract=on \
91+
// RUN: %clang -### -Werror -ffp-contract=off -fno-fast-math -ffp-contract=on \
9292
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s
9393

94-
// RUN: %clang -### -ffp-contract=on -ffast-math -c %s 2>&1 \
94+
// RUN: %clang -### -Werror -ffp-contract=on -ffast-math -c %s 2>&1 \
9595
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
9696

97-
// RUN: %clang -### -ffp-contract=off -ffast-math -c %s 2>&1 \
97+
// RUN: %clang -### -Werror -ffp-contract=off -ffast-math -c %s 2>&1 \
9898
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
9999

100-
// RUN: %clang -### -ffp-contract=fast -ffast-math -c %s 2>&1 \
100+
// RUN: %clang -### -Werror -ffp-contract=fast -ffast-math -c %s 2>&1 \
101101
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
102102

103-
// RUN: %clang -### -ffp-contract=on -ffast-math -fno-fast-math -c %s 2>&1 \
103+
// RUN: %clang -### -Werror -ffp-contract=on -ffast-math -fno-fast-math -c %s 2>&1 \
104104
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
105105

106-
// RUN: %clang -### -ffp-contract=off -ffast-math -fno-fast-math -c %s 2>&1 \
106+
// RUN: %clang -### -Werror -ffp-contract=off -ffast-math -fno-fast-math -c %s 2>&1 \
107107
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
108108

109-
// RUN: %clang -### -ffp-contract=fast -ffast-math -fno-fast-math -c %s 2>&1 \
109+
// RUN: %clang -### -Werror -ffp-contract=fast -ffast-math -fno-fast-math -c %s 2>&1 \
110110
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
111111

112-
// RUN: %clang -### -fno-fast-math -ffast-math -ffp-contract=fast \
112+
// RUN: %clang -### -Werror -fno-fast-math -ffast-math -ffp-contract=fast \
113113
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s
114114

115-
// RUN: %clang -### -fno-fast-math -ffast-math -ffp-contract=on \
115+
// RUN: %clang -### -Werror -fno-fast-math -ffast-math -ffp-contract=on \
116116
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s
117117

118-
// RUN: %clang -### -fno-fast-math -ffast-math -ffp-contract=off \
118+
// RUN: %clang -### -Werror -fno-fast-math -ffast-math -ffp-contract=off \
119119
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF %s
120120

121121
// funsafe-math-optimizations, fno-unsafe-math-optimizations
@@ -125,116 +125,113 @@
125125
// RUN: %clang -### -fno-unsafe-math-optimizations -c %s 2>&1 \
126126
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
127127

128-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on -c %s 2>&1 \
128+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=on -c %s 2>&1 \
129129
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
130130

131-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \
131+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \
132132
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
133133

134-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=fast -c %s 2>&1 \
134+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=fast -c %s 2>&1 \
135135
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
136136

137-
// RUN: %clang -### -ffp-contract=fast -funsafe-math-optimizations -c %s 2>&1 \
137+
// RUN: %clang -### -Werror -ffp-contract=fast -funsafe-math-optimizations -c %s 2>&1 \
138138
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
139-
// RUN: %clang -### -ffp-contract=on -funsafe-math-optimizations -c %s 2>&1 \
139+
// RUN: %clang -### -Werror -ffp-contract=on -funsafe-math-optimizations -c %s 2>&1 \
140140
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
141-
// RUN: %clang -### -ffp-contract=off -funsafe-math-optimizations -c %s 2>&1 \
141+
// RUN: %clang -### -Werror -ffp-contract=off -funsafe-math-optimizations -c %s 2>&1 \
142142
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
143143

144-
// RUN: %clang -### -ffp-contract=fast -fno-unsafe-math-optimizations -c \
144+
// RUN: %clang -### -Werror -ffp-contract=fast -fno-unsafe-math-optimizations -c \
145145
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s
146-
// RUN: %clang -### -ffp-contract=on -fno-unsafe-math-optimizations -c %s 2>&1 \
146+
// RUN: %clang -### -Werror -ffp-contract=on -fno-unsafe-math-optimizations -c %s 2>&1 \
147147
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
148-
// RUN: %clang -### -ffp-contract=off -fno-unsafe-math-optimizations -c %s 2>&1 \
148+
// RUN: %clang -### -Werror -ffp-contract=off -fno-unsafe-math-optimizations -c %s 2>&1 \
149149
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
150150

151-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=fast \
151+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=fast \
152152
// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s
153153

154-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on \
154+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=on \
155155
// RUN: -ffp-contract=off -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF %s
156156

157-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on \
157+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=on \
158158
// RUN: -ffp-contract=fast -c %s 2>&1 \
159159
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
160160

161-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off \
161+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=off \
162162
// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s
163163

164-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off \
164+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=off \
165165
// RUN: -ffp-contract=fast \
166166
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s
167167

168-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=on \
168+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=on \
169169
// RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \
170170
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
171171

172-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off \
172+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=off \
173173
// RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \
174174
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
175175

176-
// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=fast \
176+
// RUN: %clang -### -Werror -funsafe-math-optimizations -ffp-contract=fast \
177177
// RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \
178178
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
179179

180-
// RUN: %clang -### -funsafe-math-optimizations -fno-unsafe-math-optimizations \
180+
// RUN: %clang -### -Werror -funsafe-math-optimizations -fno-unsafe-math-optimizations \
181181
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s
182182

183-
// RUN: %clang -### -fno-unsafe-math-optimizations -funsafe-math-optimizations \
183+
// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -funsafe-math-optimizations \
184184
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s
185185

186-
// RUN: %clang -### -fno-unsafe-math-optimizations -ffp-contract=on -c %s 2>&1 \
186+
// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -ffp-contract=on -c %s 2>&1 \
187187
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
188188

189-
// RUN: %clang -### -fno-unsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \
189+
// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \
190190
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
191191

192-
// RUN: %clang -### -fno-unsafe-math-optimizations -ffp-contract=fast -c %s 2>&1 \
192+
// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -ffp-contract=fast -c %s 2>&1 \
193193
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
194194

195-
// RUN: %clang -### -ffp-contract=fast -fno-unsafe-math-optimizations \
195+
// RUN: %clang -### -Werror -ffp-contract=fast -fno-unsafe-math-optimizations \
196196
// RUN: -ffp-contract=on \
197197
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s
198198

199-
// RUN: %clang -### -ffp-contract=fast -fno-unsafe-math-optimizations \
199+
// RUN: %clang -### -Werror -ffp-contract=fast -fno-unsafe-math-optimizations \
200200
// RUN: -ffp-contract=off \
201201
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF %s
202202

203-
// RUN: %clang -### -ffp-contract=off -fno-unsafe-math-optimizations \
203+
// RUN: %clang -### -Werror -ffp-contract=off -fno-unsafe-math-optimizations \
204204
// RUN: -ffp-contract=fast \
205205
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s
206206

207-
// RUN: %clang -### -ffp-contract=off -fno-unsafe-math-optimizations \
207+
// RUN: %clang -### -Werror -ffp-contract=off -fno-unsafe-math-optimizations \
208208
// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s
209209

210-
// RUN: %clang -### -ffp-contract=on -funsafe-math-optimizations -c %s 2>&1 \
210+
// RUN: %clang -### -Werror -ffp-contract=on -funsafe-math-optimizations -c %s 2>&1 \
211211
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
212212

213-
// RUN: %clang -### -ffp-contract=off -funsafe-math-optimizations -c %s 2>&1 \
213+
// RUN: %clang -### -Werror -ffp-contract=off -funsafe-math-optimizations -c %s 2>&1 \
214214
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
215215

216-
// RUN: %clang -### -ffp-contract=fast -funsafe-math-optimizations -c %s 2>&1 \
216+
// RUN: %clang -### -Werror -ffp-contract=fast -funsafe-math-optimizations -c %s 2>&1 \
217217
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
218218

219-
// RUN: %clang -### -ffp-contract=on -funsafe-math-optimizations \
220-
// RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \
219+
// RUN: %clang -### -Werror -ffp-contract=on -funsafe-math-optimizations -fno-unsafe-math-optimizations -c %s 2>&1 \
221220
// RUN: | FileCheck --check-prefix=CHECK-FPC-ON %s
222221

223-
// RUN: %clang -### -ffp-contract=off -funsafe-math-optimizations \
224-
// RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \
222+
// RUN: %clang -### -Werror -ffp-contract=off -funsafe-math-optimizations -fno-unsafe-math-optimizations -c %s 2>&1 \
225223
// RUN: | FileCheck --check-prefix=CHECK-FPC-OFF %s
226224

227-
// RUN: %clang -### -ffp-contract=fast -funsafe-math-optimizations \
228-
// RUN: -fno-unsafe-math-optimizations -c %s 2>&1 \
225+
// RUN: %clang -### -Werror -ffp-contract=fast -funsafe-math-optimizations -fno-unsafe-math-optimizations -c %s 2>&1 \
229226
// RUN: | FileCheck --check-prefix=CHECK-FPC-FAST %s
230227

231-
// RUN: %clang -### -fno-unsafe-math-optimizations -funsafe-math-optimizations \
232-
// RUN: -ffp-contract=fast \
228+
// RUN: %clang -### -Werror -fno-unsafe-math-optimizations -funsafe-math-optimizations \
229+
// RUN: -ffp-contract=fast \
233230
// RUN: -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-FAST %s
234231

235-
// RUN: %clang -### -fno-unsafe-math-optimizations -funsafe-math-optimizations \
236-
// RUN: -ffp-contract=on -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-ON %s
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
237234

238-
// RUN: %clang -### -fno-unsafe-math-optimizations -funsafe-math-optimizations \
239-
// RUN: -ffp-contract=off -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF %s
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
240237

clang/test/Driver/fp-model.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
// CHECK-FEB-IGNORE: "-fno-rounding-math"
151151
// CHECK-FEB-IGNORE: "-ffp-exception-behavior=ignore"
152152

153-
// RUN: %clang -### -nostdinc -ffast-math -ffp-model=fast -c %s 2>&1 \
153+
// RUN: %clang -### -nostdinc -Werror -ffast-math -ffp-model=fast -c %s 2>&1 \
154154
// RUN: | FileCheck --check-prefix=CHECK-FASTMATH-FPM-FAST %s
155155
// CHECK-FASTMATH-FPM-FAST: "-cc1"
156156
// CHECK-FASTMATH-FPM-FAST: "-menable-no-infs"
@@ -165,7 +165,7 @@
165165
// CHECK-FASTMATH-FPM-FAST: "-ffast-math"
166166
// CHECK-FASTMATH-FPM-FAST: "-ffinite-math-only"
167167

168-
// RUN: %clang -### -nostdinc -ffast-math -ffp-model=precise -c %s 2>&1 \
168+
// RUN: %clang -### -nostdinc -Werror -ffast-math -ffp-model=precise -c %s 2>&1 \
169169
// RUN: | FileCheck --check-prefix=CHECK-FASTMATH-FPM-PRECISE %s
170170
// CHECK-FASTMATH-FPM-PRECISE: "-cc1"
171171
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-menable-no-infs"
@@ -180,7 +180,7 @@
180180
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-ffast-math"
181181
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-ffinite-math-only"
182182

183-
// RUN: %clang -### -nostdinc -ffast-math -ffp-model=strict -c %s 2>&1 \
183+
// RUN: %clang -### -nostdinc -Werror -ffast-math -ffp-model=strict -c %s 2>&1 \
184184
// RUN: | FileCheck --check-prefix=CHECK-FASTMATH-FPM-STRICT %s
185185
// CHECK-FASTMATH-FPM-STRICT: "-cc1"
186186
// CHECK-FASTMATH-FPM-STRICT-NOT: "-menable-no-infs"

0 commit comments

Comments
 (0)