File: fp-model.c

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (196 lines) | stat: -rw-r--r-- 9,592 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
// Test that incompatible combinations of -ffp-model= options
// and other floating point options get a warning diagnostic.
//

// RUN: %clang -### -ffp-model=fast -ffp-contract=off -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN %s
// WARN: warning: overriding '-ffp-model=fast' option with '-ffp-contract=off' [-Woverriding-option]

// RUN: %clang -### -ffp-model=fast -ffp-contract=on -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN1 %s
// WARN1: warning: overriding '-ffp-model=fast' option with '-ffp-contract=on' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -fassociative-math -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN2 %s
// WARN2: warning: overriding '-ffp-model=strict' option with '-fassociative-math' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -ffast-math -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN3 %s
// WARN3: warning: overriding '-ffp-model=strict' option with '-ffast-math' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -ffinite-math-only -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN4 %s
// WARN4: warning: overriding '-ffp-model=strict' option with '-ffinite-math-only' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -ffp-contract=fast -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN5 %s
// WARN5: warning: overriding '-ffp-model=strict' option with '-ffp-contract=fast' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -ffp-contract=on -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN7 %s
// WARN7: warning: overriding '-ffp-model=strict' option with '-ffp-contract=on' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -fno-honor-infinities -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN8 %s
// WARN8: warning: overriding '-ffp-model=strict' option with '-fno-honor-infinities' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -fno-honor-nans -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN9 %s
// WARN9: warning: overriding '-ffp-model=strict' option with '-fno-honor-nans' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -fno-rounding-math -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARNa %s
// WARNa: warning: overriding '-ffp-model=strict' option with '-fno-rounding-math' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -fno-signed-zeros -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARNb %s
// WARNb: warning: overriding '-ffp-model=strict' option with '-fno-signed-zeros' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -fno-trapping-math -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARNc %s
// WARNc: warning: overriding '-ffp-model=strict' option with '-fno-trapping-math' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -freciprocal-math -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARNd %s
// WARNd: warning: overriding '-ffp-model=strict' option with '-freciprocal-math' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -funsafe-math-optimizations -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARNe %s
// WARNe: warning: overriding '-ffp-model=strict' option with '-funsafe-math-optimizations' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -Ofast -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARNf %s
// WARNf: warning: overriding '-ffp-model=strict' option with '-Ofast' [-Woverriding-option]

// RUN: %clang -### -ffp-model=strict -fdenormal-fp-math=preserve-sign,preserve-sign -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN10 %s
// WARN10: "-cc1"
// WARN10-NOT: warning: overriding '-ffp-model=strict' option with '-fdenormal-fp-math=preserve-sign,preserve-sign' [-Woverriding-option]

// RUN: %clang -### -ffp-model=fast -ffp-model=strict -c %s 2>&1 | FileCheck \
// RUN:   --check-prefix=WARN11 %s
// WARN11: warning: overriding '-ffp-model=fast' option with '-ffp-model=strict' [-Woverriding-option]
// WARN11-NOT: warning: overriding '-ffp-model=strict' option with '-ffp-model=strict' [-Woverriding-option]

// RUN: %clang -### -Ofast -ffp-model=strict -c %s 2>&1 | FileCheck \
// RUN:   --check-prefix=WARN12 %s
// RUN: %clang -### -Werror -ffast-math -ffp-model=strict -c %s
// WARN12: warning: overriding '-ffp-model=strict' option with '-Ofast'

// RUN: %clang -### -ffp-model=strict -fapprox-func -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=WARN13 %s
// WARN13: warning: overriding '-ffp-model=strict' option with '-fapprox-func' [-Woverriding-option]

// RUN: %clang -### -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-NOROUND %s
// CHECK-NOROUND: "-cc1"
// CHECK-NOROUND: "-fno-rounding-math"

// RUN: %clang -### -frounding-math -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-ROUND --implicit-check-not ffp-exception-behavior=strict %s
// CHECK-ROUND: "-cc1"
// CHECK-ROUND: "-frounding-math"

// RUN: %clang -### -ftrapping-math -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-TRAP %s
// CHECK-TRAP: "-cc1"
// CHECK-TRAP: "-ffp-exception-behavior=strict"

// RUN: %clang -### -nostdinc -ffp-model=fast -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-FPM-FAST %s
// CHECK-FPM-FAST: "-cc1"
// CHECK-FPM-FAST: "-menable-no-infs"
// CHECK-FPM-FAST: "-menable-no-nans"
// CHECK-FPM-FAST: "-fapprox-func"
// CHECK-FPM-FAST: "-funsafe-math-optimizations"
// CHECK-FPM-FAST: "-fno-signed-zeros"
// CHECK-FPM-FAST: "-mreassociate"
// CHECK-FPM-FAST: "-freciprocal-math"
// CHECK-FPM-FAST: "-ffp-contract=fast"
// CHECK-FPM-FAST: "-fno-rounding-math"
// CHECK-FPM-FAST: "-ffast-math"
// CHECK-FPM-FAST: "-ffinite-math-only"

// RUN: %clang -### -nostdinc -ffp-model=precise -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-FPM-PRECISE %s
// CHECK-FPM-PRECISE: "-cc1"
// CHECK-FPM-PRECISE: "-ffp-contract=on"
// CHECK-FPM-PRECISE: "-fno-rounding-math"

// RUN: %clang -### -nostdinc -ffp-model=strict -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-FPM-STRICT %s
// CHECK-FPM-STRICT: "-cc1"
// CHECK-FPM-STRICT: "-frounding-math"
// CHECK-FPM-STRICT: "-ffp-exception-behavior=strict"

// RUN: %clang -### -nostdinc -ffp-model=strict -ffp-model=fast -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-NO-EXCEPT %s
// RUN: %clang -### -nostdinc -ffp-model=strict -ffast-math -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-NO-EXCEPT %s
// RUN: %clang -### -nostdinc -ffp-model=strict -Ofast -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-NO-EXCEPT %s
// CHECK-NO-EXCEPT: "-cc1"
// CHECK-NO-EXCEPT-NOT: "-ffp-exception-behavior=strict"

// RUN: %clang -### -nostdinc -ffp-exception-behavior=strict -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-FEB-STRICT %s
// CHECK-FEB-STRICT: "-cc1"
// CHECK-FEB-STRICT: "-fno-rounding-math"
// CHECK-FEB-STRICT: "-ffp-exception-behavior=strict"

// RUN: %clang -### -nostdinc -ffp-exception-behavior=maytrap -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-FEB-MAYTRAP %s
// CHECK-FEB-MAYTRAP: "-cc1"
// CHECK-FEB-MAYTRAP: "-fno-rounding-math"
// CHECK-FEB-MAYTRAP: "-ffp-exception-behavior=maytrap"

// RUN: %clang -### -nostdinc -ffp-exception-behavior=ignore -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-FEB-IGNORE %s
// CHECK-FEB-IGNORE: "-cc1"
// CHECK-FEB-IGNORE: "-fno-rounding-math"
// CHECK-FEB-IGNORE: "-ffp-exception-behavior=ignore"

// RUN: %clang -### -nostdinc -Werror -ffast-math -ffp-model=fast -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-FASTMATH-FPM-FAST %s
// CHECK-FASTMATH-FPM-FAST: "-cc1"
// CHECK-FASTMATH-FPM-FAST: "-menable-no-infs"
// CHECK-FASTMATH-FPM-FAST: "-menable-no-nans"
// CHECK-FASTMATH-FPM-FAST: "-fapprox-func"
// CHECK-FASTMATH-FPM-FAST: "-funsafe-math-optimizations"
// CHECK-FASTMATH-FPM-FAST: "-fno-signed-zeros"
// CHECK-FASTMATH-FPM-FAST: "-mreassociate"
// CHECK-FASTMATH-FPM-FAST: "-freciprocal-math"
// CHECK-FASTMATH-FPM-FAST: "-ffp-contract=fast"
// CHECK-FASTMATH-FPM-FAST: "-fno-rounding-math"
// CHECK-FASTMATH-FPM-FAST: "-ffast-math"
// CHECK-FASTMATH-FPM-FAST: "-ffinite-math-only"

// RUN: %clang -### -nostdinc -Werror -ffast-math -ffp-model=precise -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-FASTMATH-FPM-PRECISE %s
// CHECK-FASTMATH-FPM-PRECISE:     "-cc1"
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-menable-no-infs"
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-menable-no-nans"
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-fapprox-func"
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-funsafe-math-optimizations"
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-fno-signed-zeros"
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-mreassociate"
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-freciprocal-math"
// CHECK-FASTMATH-FPM-PRECISE:     "-ffp-contract=on"
// CHECK-FASTMATH-FPM-PRECISE:     "-fno-rounding-math"
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-ffast-math"
// CHECK-FASTMATH-FPM-PRECISE-NOT: "-ffinite-math-only"

// RUN: %clang -### -nostdinc -Werror -ffast-math -ffp-model=strict -c %s 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-FASTMATH-FPM-STRICT %s
// CHECK-FASTMATH-FPM-STRICT:     "-cc1"
// CHECK-FASTMATH-FPM-STRICT-NOT: "-menable-no-infs"
// CHECK-FASTMATH-FPM-STRICT-NOT: "-menable-no-nans"
// CHECK-FASTMATH-FPM-STRICT-NOT: "-fapprox-func"
// CHECK-FASTMATH-FPM-STRICT-NOT: "-funsafe-math-optimizations"
// CHECK-FASTMATH-FPM-STRICT-NOT: "-fno-signed-zeros"
// CHECK-FASTMATH-FPM-STRICT-NOT: "-mreassociate"
// CHECK-FASTMATH-FPM-STRICT-NOT: "-freciprocal-math"
// CHECK-FASTMATH-FPM-STRICT:     "-ffp-contract=off"
// CHECK-FASTMATH-FPM-STRICT-NOT: "-fno-rounding-math"
// CHECK-FASTMATH-FPM-STRICT-NOT: "-ffast-math"
// CHECK-FASTMATH-FPM-STRICT-NOT: "-ffinite-math-only"