|
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=on -c %s 2>&1 \ |
| 28 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -ffp-contract=fast -c %s 2>&1 \ |
| 29 | +// RUN: | FileCheck --check-prefix=WARN6 %s |
| 30 | +// WARN6: warning: overriding '-ffp-model=strict' option with '-ffp-contract=fast' [-Woverriding-t-option] |
| 31 | + |
| 32 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -ffp-contract=on -c %s 2>&1 \ |
31 | 33 | // RUN: | FileCheck --check-prefix=WARN7 %s
|
32 | 34 | // WARN7: warning: overriding '-ffp-model=strict' option with '-ffp-contract=on' [-Woverriding-t-option]
|
33 | 35 |
|
34 |
| -// 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 \ |
35 | 37 | // RUN: | FileCheck --check-prefix=WARN8 %s
|
36 | 38 | // WARN8: warning: overriding '-ffp-model=strict' option with '-fno-honor-infinities' [-Woverriding-t-option]
|
37 | 39 |
|
38 |
| -// 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 \ |
39 | 41 | // RUN: | FileCheck --check-prefix=WARN9 %s
|
40 | 42 | // WARN9: warning: overriding '-ffp-model=strict' option with '-fno-honor-nans' [-Woverriding-t-option]
|
41 | 43 |
|
42 |
| -// 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 \ |
43 | 45 | // RUN: | FileCheck --check-prefix=WARNa %s
|
44 | 46 | // WARNa: warning: overriding '-ffp-model=strict' option with '-fno-rounding-math' [-Woverriding-t-option]
|
45 | 47 |
|
46 |
| -// 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 \ |
47 | 49 | // RUN: | FileCheck --check-prefix=WARNb %s
|
48 | 50 | // WARNb: warning: overriding '-ffp-model=strict' option with '-fno-signed-zeros' [-Woverriding-t-option]
|
49 | 51 |
|
50 |
| -// 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 \ |
51 | 53 | // RUN: | FileCheck --check-prefix=WARNc %s
|
52 | 54 | // WARNc: warning: overriding '-ffp-model=strict' option with '-fno-trapping-math' [-Woverriding-t-option]
|
53 | 55 |
|
54 |
| -// 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 \ |
55 | 57 | // RUN: | FileCheck --check-prefix=WARNd %s
|
56 | 58 | // WARNd: warning: overriding '-ffp-model=strict' option with '-freciprocal-math' [-Woverriding-t-option]
|
57 | 59 |
|
58 |
| -// 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 \ |
59 | 61 | // RUN: | FileCheck --check-prefix=WARNe %s
|
60 | 62 | // WARNe: warning: overriding '-ffp-model=strict' option with '-funsafe-math-optimizations' [-Woverriding-t-option]
|
61 | 63 |
|
62 |
| -// RUN: %clang -### -ffp-model=strict -Ofast -c %s 2>&1 \ |
| 64 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -Ofast -c %s 2>&1 \ |
63 | 65 | // RUN: | FileCheck --check-prefix=WARNf %s
|
64 | 66 | // WARNf: warning: overriding '-ffp-model=strict' option with '-Ofast' [-Woverriding-t-option]
|
65 | 67 |
|
66 |
| -// RUN: %clang -### -ffp-model=strict -fdenormal-fp-math=preserve-sign,preserve-sign -c %s 2>&1 \ |
| 68 | +// RUN: %clang -target x86_64 -### -ffp-model=strict -fdenormal-fp-math=preserve-sign,preserve-sign -c %s 2>&1 \ |
67 | 69 | // RUN: | FileCheck --check-prefix=WARN10 %s
|
68 | 70 | // WARN10: warning: overriding '-ffp-model=strict' option with '-fdenormal-fp-math=preserve-sign,preserve-sign' [-Woverriding-t-option]
|
69 | 71 |
|
70 |
| -// RUN: %clang -### -c %s 2>&1 \ |
| 72 | +// RUN: %clang -target x86_64 -### -c %s 2>&1 \ |
71 | 73 | // RUN: | FileCheck --check-prefix=CHECK-NOROUND %s
|
72 | 74 | // CHECK-NOROUND: "-cc1"
|
73 | 75 | // CHECK-NOROUND: "-fno-rounding-math"
|
74 | 76 |
|
75 |
| -// RUN: %clang -### -frounding-math -c %s 2>&1 \ |
| 77 | +// RUN: %clang -target x86_64 -### -frounding-math -c %s 2>&1 \ |
76 | 78 | // RUN: | FileCheck --check-prefix=CHECK-ROUND --implicit-check-not ffp-exception-behavior=strict %s
|
77 | 79 | // CHECK-ROUND: "-cc1"
|
78 | 80 | // CHECK-ROUND: "-frounding-math"
|
79 | 81 |
|
80 |
| -// RUN: %clang -### -ftrapping-math -c %s 2>&1 \ |
| 82 | +// RUN: %clang -target x86_64 -### -ftrapping-math -c %s 2>&1 \ |
81 | 83 | // RUN: | FileCheck --check-prefix=CHECK-TRAP %s
|
82 | 84 | // CHECK-TRAP: "-cc1"
|
83 | 85 | // CHECK-TRAP: "-ffp-exception-behavior=strict"
|
84 | 86 |
|
85 |
| -// RUN: %clang -### -nostdinc -ffp-model=fast -c %s 2>&1 \ |
| 87 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-model=fast -c %s 2>&1 \ |
86 | 88 | // RUN: | FileCheck --check-prefix=CHECK-FPM-FAST %s
|
87 | 89 | // CHECK-FPM-FAST: "-cc1"
|
88 | 90 | // CHECK-FPM-FAST: "-menable-no-infs"
|
|
96 | 98 | // CHECK-FPM-FAST: "-ffast-math"
|
97 | 99 | // CHECK-FPM-FAST: "-ffinite-math-only"
|
98 | 100 |
|
99 |
| -// RUN: %clang -### -nostdinc -ffp-model=precise -c %s 2>&1 \ |
| 101 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-model=precise -c %s 2>&1 \ |
100 | 102 | // RUN: | FileCheck --check-prefix=CHECK-FPM-PRECISE %s
|
101 | 103 | // CHECK-FPM-PRECISE: "-cc1"
|
102 |
| -// CHECK-FPM-PRECISE: "-ffp-contract=fast" |
| 104 | +// CHECK-FPM-PRECISE: "-ffp-contract=on" |
103 | 105 | // CHECK-FPM-PRECISE: "-fno-rounding-math"
|
104 | 106 |
|
105 |
| -// RUN: %clang -### -nostdinc -ffp-model=strict -c %s 2>&1 \ |
| 107 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-model=strict -c %s 2>&1 \ |
106 | 108 | // RUN: | FileCheck --check-prefix=CHECK-FPM-STRICT %s
|
107 | 109 | // CHECK-FPM-STRICT: "-cc1"
|
| 110 | +// CHECK-FPM-STRICT: "-fmath-errno" |
| 111 | +// CHECK-FPM-STRICT: "-ffp-contract=off" |
108 | 112 | // CHECK-FPM-STRICT: "-frounding-math"
|
109 | 113 | // CHECK-FPM-STRICT: "-ffp-exception-behavior=strict"
|
110 | 114 |
|
111 | 115 |
|
112 |
| -// RUN: %clang -### -nostdinc -ffp-exception-behavior=strict -c %s 2>&1 \ |
| 116 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-exception-behavior=strict -c %s 2>&1 \ |
113 | 117 | // RUN: | FileCheck --check-prefix=CHECK-FEB-STRICT %s
|
114 | 118 | // CHECK-FEB-STRICT: "-cc1"
|
115 | 119 | // CHECK-FEB-STRICT: "-fno-rounding-math"
|
116 | 120 | // CHECK-FEB-STRICT: "-ffp-exception-behavior=strict"
|
117 | 121 |
|
118 |
| -// RUN: %clang -### -nostdinc -ffp-exception-behavior=maytrap -c %s 2>&1 \ |
| 122 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-exception-behavior=maytrap -c %s 2>&1 \ |
119 | 123 | // RUN: | FileCheck --check-prefix=CHECK-FEB-MAYTRAP %s
|
120 | 124 | // CHECK-FEB-MAYTRAP: "-cc1"
|
121 | 125 | // CHECK-FEB-MAYTRAP: "-fno-rounding-math"
|
122 | 126 | // CHECK-FEB-MAYTRAP: "-ffp-exception-behavior=maytrap"
|
123 | 127 |
|
124 |
| -// RUN: %clang -### -nostdinc -ffp-exception-behavior=ignore -c %s 2>&1 \ |
| 128 | +// RUN: %clang -target x86_64 -### -nostdinc -ffp-exception-behavior=ignore -c %s 2>&1 \ |
125 | 129 | // RUN: | FileCheck --check-prefix=CHECK-FEB-IGNORE %s
|
126 | 130 | // CHECK-FEB-IGNORE: "-cc1"
|
127 | 131 | // CHECK-FEB-IGNORE: "-fno-rounding-math"
|
128 | 132 | // CHECK-FEB-IGNORE: "-ffp-exception-behavior=ignore"
|
129 |
| - |
|
0 commit comments