|
1 | 1 | // Test that incompatible combinations of -ffp-model= options
|
2 | 2 | // and other floating point options get a warning diagnostic.
|
3 |
| -// |
4 |
| -// REQUIRES: clang-driver |
5 | 3 |
|
6 |
| -// RUN: %clang -### -ffp-model=fast -ffp-contract=off -c %s 2>&1 \ |
| 4 | +// RUN: %clang -target x86_64 -### -ffp-model=fast -ffp-contract=off -c %s 2>&1 \ |
7 | 5 | // RUN: | FileCheck --check-prefix=WARN %s
|
8 | 6 | // WARN: warning: overriding '-ffp-model=fast' option with '-ffp-contract=off' [-Woverriding-t-option]
|
9 | 7 |
|
10 |
| -// RUN: %clang -### -ffp-model=fast -ffp-contract=on -c %s 2>&1 \ |
| 8 | +// RUN: %clang -target x86_64 -### -ffp-model=fast -ffp-contract=on -c %s 2>&1 \ |
11 | 9 | // RUN: | FileCheck --check-prefix=WARN1 %s
|
12 | 10 | // WARN1: warning: overriding '-ffp-model=fast' option with '-ffp-contract=on' [-Woverriding-t-option]
|
13 | 11 |
|
14 |
| -// RUN: %clang -### -ffp-model=strict -fassociative-math -c %s 2>&1 \ |
| 12 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -fassociative-math -c %s 2>&1 \ |
15 | 13 | // RUN: | FileCheck --check-prefix=WARN2 %s
|
16 | 14 | // WARN2: warning: overriding '-ffp-model=strict' option with '-fassociative-math' [-Woverriding-t-option]
|
17 | 15 |
|
18 |
| -// RUN: %clang -### -ffp-model=strict -ffast-math -c %s 2>&1 \ |
| 16 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -ffast-math -c %s 2>&1 \ |
19 | 17 | // RUN: | FileCheck --check-prefix=WARN3 %s
|
20 | 18 | // WARN3: warning: overriding '-ffp-model=strict' option with '-ffast-math' [-Woverriding-t-option]
|
21 | 19 |
|
22 |
| -// RUN: %clang -### -ffp-model=strict -ffinite-math-only -c %s 2>&1 \ |
| 20 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -ffinite-math-only -c %s 2>&1 \ |
23 | 21 | // RUN: | FileCheck --check-prefix=WARN4 %s
|
24 | 22 | // WARN4: warning: overriding '-ffp-model=strict' option with '-ffinite-math-only' [-Woverriding-t-option]
|
25 | 23 |
|
26 |
| -// RUN: %clang -### -ffp-model=strict -ffp-contract=fast -c %s 2>&1 \ |
| 24 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -ffp-contract=fast -c %s 2>&1 \ |
27 | 25 | // RUN: | FileCheck --check-prefix=WARN5 %s
|
28 | 26 | // WARN5: warning: overriding '-ffp-model=strict' option with '-ffp-contract=fast' [-Woverriding-t-option]
|
29 | 27 |
|
30 |
| -// RUN: %clang -### -ffp-model=strict -ffp-contract=off -c %s 2>&1 \ |
| 28 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -ffp-contract=fast -c %s 2>&1 \ |
31 | 29 | // RUN: | FileCheck --check-prefix=WARN6 %s
|
32 |
| -// WARN6: warning: overriding '-ffp-model=strict' option with '-ffp-contract=off' [-Woverriding-t-option] |
| 30 | +// WARN6: warning: overriding '-ffp-model=strict' option with '-ffp-contract=fast' [-Woverriding-t-option] |
33 | 31 |
|
34 |
| -// RUN: %clang -### -ffp-model=strict -ffp-contract=on -c %s 2>&1 \ |
| 32 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -ffp-contract=on -c %s 2>&1 \ |
35 | 33 | // RUN: | FileCheck --check-prefix=WARN7 %s
|
36 | 34 | // WARN7: warning: overriding '-ffp-model=strict' option with '-ffp-contract=on' [-Woverriding-t-option]
|
37 | 35 |
|
38 |
| -// RUN: %clang -### -ffp-model=strict -fno-honor-infinities -c %s 2>&1 \ |
| 36 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -fno-honor-infinities -c %s 2>&1 \ |
39 | 37 | // RUN: | FileCheck --check-prefix=WARN8 %s
|
40 | 38 | // WARN8: warning: overriding '-ffp-model=strict' option with '-fno-honor-infinities' [-Woverriding-t-option]
|
41 | 39 |
|
42 |
| -// RUN: %clang -### -ffp-model=strict -fno-honor-nans -c %s 2>&1 \ |
| 40 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -fno-honor-nans -c %s 2>&1 \ |
43 | 41 | // RUN: | FileCheck --check-prefix=WARN9 %s
|
44 | 42 | // WARN9: warning: overriding '-ffp-model=strict' option with '-fno-honor-nans' [-Woverriding-t-option]
|
45 | 43 |
|
46 |
| -// RUN: %clang -### -ffp-model=strict -fno-rounding-math -c %s 2>&1 \ |
| 44 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -fno-rounding-math -c %s 2>&1 \ |
47 | 45 | // RUN: | FileCheck --check-prefix=WARNa %s
|
48 | 46 | // WARNa: warning: overriding '-ffp-model=strict' option with '-fno-rounding-math' [-Woverriding-t-option]
|
49 | 47 |
|
50 |
| -// RUN: %clang -### -ffp-model=strict -fno-signed-zeros -c %s 2>&1 \ |
| 48 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -fno-signed-zeros -c %s 2>&1 \ |
51 | 49 | // RUN: | FileCheck --check-prefix=WARNb %s
|
52 | 50 | // WARNb: warning: overriding '-ffp-model=strict' option with '-fno-signed-zeros' [-Woverriding-t-option]
|
53 | 51 |
|
54 |
| -// RUN: %clang -### -ffp-model=strict -fno-trapping-math -c %s 2>&1 \ |
| 52 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -fno-trapping-math -c %s 2>&1 \ |
55 | 53 | // RUN: | FileCheck --check-prefix=WARNc %s
|
56 | 54 | // WARNc: warning: overriding '-ffp-model=strict' option with '-fno-trapping-math' [-Woverriding-t-option]
|
57 | 55 |
|
58 |
| -// RUN: %clang -### -ffp-model=strict -freciprocal-math -c %s 2>&1 \ |
| 56 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -freciprocal-math -c %s 2>&1 \ |
59 | 57 | // RUN: | FileCheck --check-prefix=WARNd %s
|
60 | 58 | // WARNd: warning: overriding '-ffp-model=strict' option with '-freciprocal-math' [-Woverriding-t-option]
|
61 | 59 |
|
62 |
| -// RUN: %clang -### -ffp-model=strict -funsafe-math-optimizations -c %s 2>&1 \ |
| 60 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -funsafe-math-optimizations -c %s 2>&1 \ |
63 | 61 | // RUN: | FileCheck --check-prefix=WARNe %s
|
64 | 62 | // WARNe: warning: overriding '-ffp-model=strict' option with '-funsafe-math-optimizations' [-Woverriding-t-option]
|
65 | 63 |
|
66 |
| -// RUN: %clang -### -ffp-model=strict -Ofast -c %s 2>&1 \ |
| 64 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -Ofast -c %s 2>&1 \ |
67 | 65 | // RUN: | FileCheck --check-prefix=WARNf %s
|
68 | 66 | // WARNf: warning: overriding '-ffp-model=strict' option with '-Ofast' [-Woverriding-t-option]
|
69 | 67 |
|
70 |
| -// RUN: %clang -### -c %s 2>&1 \ |
| 68 | +// RUN: %clang -target x86_64 -### -c %s 2>&1 \ |
71 | 69 | // RUN: | FileCheck --check-prefix=CHECK-NOROUND %s
|
72 | 70 | // CHECK-NOROUND: "-cc1"
|
73 | 71 | // CHECK-NOROUND: "-fno-rounding-math"
|
74 | 72 |
|
75 |
| -// RUN: %clang -### -frounding-math -c %s 2>&1 \ |
| 73 | +// RUN: %clang -target x86_64 -### -frounding-math -c %s 2>&1 \ |
76 | 74 | // RUN: | FileCheck --check-prefix=CHECK-ROUND --implicit-check-not ffp-exception-behavior=strict %s
|
77 | 75 | // CHECK-ROUND: "-cc1"
|
78 | 76 | // CHECK-ROUND: "-frounding-math"
|
79 | 77 |
|
80 |
| -// RUN: %clang -### -ftrapping-math -c %s 2>&1 \ |
| 78 | +// RUN: %clang -target x86_64 -### -ftrapping-math -c %s 2>&1 \ |
81 | 79 | // RUN: | FileCheck --check-prefix=CHECK-TRAP %s
|
82 | 80 | // CHECK-TRAP: "-cc1"
|
83 | 81 | // CHECK-TRAP: "-ftrapping-math"
|
84 | 82 | // CHECK-TRAP: "-ffp-exception-behavior=strict"
|
85 | 83 |
|
86 |
| -// RUN: %clang -### -nostdinc -ffp-model=fast -c %s 2>&1 \ |
| 84 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-model=fast -c %s 2>&1 \ |
87 | 85 | // RUN: | FileCheck --check-prefix=CHECK-FPM-FAST %s
|
88 | 86 | // CHECK-FPM-FAST: "-cc1"
|
89 | 87 | // CHECK-FPM-FAST: "-menable-no-infs"
|
|
97 | 95 | // CHECK-FPM-FAST: "-ffast-math"
|
98 | 96 | // CHECK-FPM-FAST: "-ffinite-math-only"
|
99 | 97 |
|
100 |
| -// RUN: %clang -### -nostdinc -ffp-model=precise -c %s 2>&1 \ |
| 98 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-model=precise -c %s 2>&1 \ |
101 | 99 | // RUN: | FileCheck --check-prefix=CHECK-FPM-PRECISE %s
|
102 | 100 | // CHECK-FPM-PRECISE: "-cc1"
|
103 |
| -// CHECK-FPM-PRECISE: "-ffp-contract=fast" |
| 101 | +// CHECK-FPM-PRECISE: "-ffp-contract=on" |
104 | 102 | // CHECK-FPM-PRECISE: "-fno-rounding-math"
|
105 | 103 |
|
106 |
| -// RUN: %clang -### -nostdinc -ffp-model=strict -c %s 2>&1 \ |
| 104 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-model=strict -c %s 2>&1 \ |
107 | 105 | // RUN: | FileCheck --check-prefix=CHECK-FPM-STRICT %s
|
108 | 106 | // CHECK-FPM-STRICT: "-cc1"
|
109 | 107 | // CHECK-FPM-STRICT: "-ftrapping-math"
|
| 108 | +// CHECK-FPM-STRICT: "-ffp-contract=off" |
110 | 109 | // CHECK-FPM-STRICT: "-frounding-math"
|
111 | 110 | // CHECK-FPM-STRICT: "-ffp-exception-behavior=strict"
|
112 | 111 |
|
113 |
| -// RUN: %clang -### -nostdinc -ftrapping-math -ffp-exception-behavior=ignore -c %s 2>&1 \ |
| 112 | +// RUN: %clang -target x86_64 -### -nostdinc -ftrapping-math -ffp-exception-behavior=ignore -c %s 2>&1 \ |
114 | 113 | // RUN: | FileCheck --check-prefix=CHECK-TRAP-IGNORE %s
|
115 | 114 | // CHECK-TRAP-IGNORE: "-cc1"
|
116 | 115 | // CHECK-TRAP-IGNORE: "-fno-rounding-math"
|
117 | 116 | // CHECK-TRAP-IGNORE: "-ffp-exception-behavior=ignore"
|
118 | 117 |
|
119 | 118 |
|
120 |
| -// RUN: %clang -### -nostdinc -ffp-exception-behavior=strict -c %s 2>&1 \ |
| 119 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-exception-behavior=strict -c %s 2>&1 \ |
121 | 120 | // RUN: | FileCheck --check-prefix=CHECK-FEB-STRICT %s
|
122 | 121 | // CHECK-FEB-STRICT: "-cc1"
|
123 | 122 | // CHECK-FEB-STRICT: "-fno-rounding-math"
|
124 | 123 | // CHECK-FEB-STRICT: "-ffp-exception-behavior=strict"
|
125 | 124 |
|
126 |
| -// RUN: %clang -### -nostdinc -ffp-exception-behavior=maytrap -c %s 2>&1 \ |
| 125 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-exception-behavior=maytrap -c %s 2>&1 \ |
127 | 126 | // RUN: | FileCheck --check-prefix=CHECK-FEB-MAYTRAP %s
|
128 | 127 | // CHECK-FEB-MAYTRAP: "-cc1"
|
129 | 128 | // CHECK-FEB-MAYTRAP: "-fno-rounding-math"
|
130 | 129 | // CHECK-FEB-MAYTRAP: "-ffp-exception-behavior=maytrap"
|
131 | 130 |
|
132 |
| -// RUN: %clang -### -nostdinc -ffp-exception-behavior=ignore -c %s 2>&1 \ |
| 131 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-exception-behavior=ignore -c %s 2>&1 \ |
133 | 132 | // RUN: | FileCheck --check-prefix=CHECK-FEB-IGNORE %s
|
134 | 133 | // CHECK-FEB-IGNORE: "-cc1"
|
135 | 134 | // CHECK-FEB-IGNORE: "-fno-rounding-math"
|
136 | 135 | // CHECK-FEB-IGNORE: "-ffp-exception-behavior=ignore"
|
137 |
| - |
0 commit comments