1 // Test range options for complex multiplication and division.
3 // RUN: %clang -### -target x86_64 -fcx-limited-range -c %s 2>&1 \
4 // RUN: | FileCheck --check-prefix=BASIC %s
6 // RUN: %clang -### -target x86_64 -fno-cx-limited-range -c %s 2>&1 \
7 // RUN: | FileCheck --check-prefix=FULL %s
9 // RUN: %clang -### -target x86_64 -fcx-limited-range -fcx-fortran-rules \
10 // RUN: -c %s 2>&1 | FileCheck --check-prefix=WARN1 %s
12 // RUN: %clang -### -target x86_64 -fno-cx-limited-range -fcx-fortran-rules \
13 // RUN: -c %s 2>&1 | FileCheck --check-prefix=WARN2 %s
15 // RUN: %clang -### -target x86_64 -fcx-limited-range -fno-cx-limited-range \
16 // RUN: -c %s 2>&1 | FileCheck --check-prefix=FULL %s
18 // RUN: %clang -### -target x86_64 -fno-cx-limited-range -fcx-limited-range \
19 // RUN: -c %s 2>&1 | FileCheck --check-prefix=BASIC %s
21 // RUN: %clang -### -target x86_64 -fno-cx-limited-range -fno-cx-fortran-rules \
22 // RUN: -c %s 2>&1 | FileCheck --check-prefix=FULL %s
24 // RUN: %clang -### -target x86_64 -fno-cx-fortran-rules -fno-cx-limited-range \
25 // RUN: -c %s 2>&1 | FileCheck --check-prefix=FULL %s
27 // RUN: %clang -### -target x86_64 -fcx-limited-range -fno-cx-fortran-rules \
28 // RUN: -c %s 2>&1 | FileCheck --check-prefix=WARN4 %s
30 // RUN: %clang -### -target x86_64 -fcx-fortran-rules -c %s 2>&1 \
31 // RUN: | FileCheck --check-prefix=IMPRVD %s
33 // RUN: %clang -### -target x86_64 -fno-cx-fortran-rules -c %s 2>&1 \
34 // RUN: | FileCheck --check-prefix=FULL %s
36 // RUN: %clang -### -target x86_64 -fcx-fortran-rules -c %s 2>&1 \
37 // RUN: -fno-cx-fortran-rules | FileCheck --check-prefix=FULL %s
39 // RUN: %clang -### -target x86_64 -fcx-fortran-rules -fno-cx-limited-range \
40 // RUN: -c %s 2>&1 | FileCheck --check-prefix=WARN3 %s
42 // RUN: %clang -### -target x86_64 -fno-cx-fortran-rules -c %s 2>&1 \
43 // RUN: | FileCheck %s
45 // RUN: %clang -### -target x86_64 -fcx-limited-range -fcx-fortran-rules \
46 // RUN: -c %s 2>&1 | FileCheck --check-prefix=WARN1 %s
48 // RUN: %clang -### -target x86_64 -fcx-limited-range -fno-cx-fortran-rules \
49 // RUN: -c %s 2>&1 | FileCheck --check-prefix=WARN4 %s
51 // RUN: %clang -### -target x86_64 -fcx-limited-range -fno-cx-limited-range \
52 // RUN: -c %s 2>&1 | FileCheck --check-prefix=FULL %s
54 // RUN: %clang -### -target x86_64 -fcx-fortran-rules \
55 // RUN: -fcx-limited-range -c %s 2>&1 \
56 // RUN: | FileCheck --check-prefix=WARN20 %s
58 // RUN: %clang -### -target x86_64 -ffast-math -c %s 2>&1 \
59 // RUN: | FileCheck --check-prefix=BASIC %s
61 // RUN: %clang -### -target x86_64 -ffast-math -fcx-limited-range -c %s 2>&1 \
62 // RUN: | FileCheck --check-prefix=BASIC %s
64 // RUN: %clang -### -target x86_64 -fcx-limited-range -ffast-math -c %s 2>&1 \
65 // RUN: | FileCheck --check-prefix=BASIC %s
67 // RUN: %clang -### -target x86_64 -ffast-math -fno-cx-limited-range \
68 // RUN: -c %s 2>&1 | FileCheck --check-prefix=FULL %s
70 // RUN: not %clang -### -target x86_64 -fcomplex-arithmetic=foo -c %s 2>&1 \
71 // RUN: | FileCheck --check-prefix=ERR %s
73 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=basic -c %s 2>&1 \
74 // RUN: | FileCheck --check-prefix=BASIC %s
76 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=improved -c %s 2>&1 \
77 // RUN: | FileCheck --check-prefix=IMPRVD %s
79 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=promoted -c %s 2>&1 \
80 // RUN: | FileCheck --check-prefix=PRMTD %s
82 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=full -c %s 2>&1 \
83 // RUN: | FileCheck --check-prefix=FULL %s
85 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=basic \
86 // RUN: -fcx-limited-range -c %s 2>&1 \
87 // RUN: | FileCheck --check-prefix=BASIC %s
89 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=basic \
90 // RUN: -fcomplex-arithmetic=improved -c %s 2>&1 \
91 // RUN: | FileCheck --check-prefix=IMPRVD %s
93 // RUN: %clang -### -target x86_64 -fcx-limited-range \
94 // RUN: -fcomplex-arithmetic=improved -c %s 2>&1 \
95 // RUN: | FileCheck --check-prefix=WARN6 %s
97 // RUN: %clang -### -target x86_64 -fcx-fortran-rules \
98 // RUN: -fcomplex-arithmetic=basic -c %s 2>&1 \
99 // RUN: | FileCheck --check-prefix=WARN7 %s
101 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=basic \
102 // RUN: -fcomplex-arithmetic=full -c %s 2>&1 \
103 // RUN: | FileCheck --check-prefix=FULL %s
105 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=basic \
106 // RUN: -fcomplex-arithmetic=promoted -c %s 2>&1 \
107 // RUN: | FileCheck --check-prefix=PRMTD %s
109 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=improved \
110 // RUN: -fcomplex-arithmetic=basic -c %s 2>&1 \
111 // RUN: | FileCheck --check-prefix=BASIC %s
113 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=improved \
114 // RUN: -fcomplex-arithmetic=full -c %s 2>&1 \
115 // RUN: | FileCheck --check-prefix=FULL %s
117 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=improved \
118 // RUN: -fcomplex-arithmetic=promoted -c %s 2>&1 \
119 // RUN: | FileCheck --check-prefix=PRMTD %s
122 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=promoted \
123 // RUN: -fcomplex-arithmetic=basic -c %s 2>&1 \
124 // RUN: | FileCheck --check-prefix=BASIC %s
126 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=promoted \
127 // RUN: -fcx-limited-range -c %s 2>&1 \
128 // RUN: | FileCheck --check-prefix=WARN14 %s
130 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=promoted \
131 // RUN: -fcomplex-arithmetic=improved -c %s 2>&1 \
132 // RUN: | FileCheck --check-prefix=IMPRVD %s
134 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=promoted \
135 // RUN: -fcomplex-arithmetic=full -c %s 2>&1 \
136 // RUN: | FileCheck --check-prefix=FULL %s
138 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=full \
139 // RUN: -fcomplex-arithmetic=basic -c %s 2>&1 \
140 // RUN: | FileCheck --check-prefix=BASIC %s
142 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=full \
143 // RUN: -ffast-math -c %s 2>&1 | FileCheck --check-prefix=WARN17 %s
145 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=full \
146 // RUN: -fcomplex-arithmetic=improved -c %s 2>&1 \
147 // RUN: | FileCheck --check-prefix=IMPRVD %s
149 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=full \
150 // RUN: -fcomplex-arithmetic=promoted -c %s 2>&1 \
151 // RUN: | FileCheck --check-prefix=PRMTD %s
153 // RUN: %clang -### -target x86_64 -ffast-math -c %s 2>&1 \
154 // RUN: | FileCheck --check-prefix=BASIC %s
156 // RUN: %clang -### -target x86_64 -ffast-math -fcx-limited-range -c %s 2>&1 \
157 // RUN: | FileCheck --check-prefix=BASIC %s
159 // RUN: %clang -### -target x86_64 -fcx-limited-range -ffast-math -c %s 2>&1 \
160 // RUN: | FileCheck --check-prefix=BASIC %s
162 // RUN: %clang -### -target x86_64 -ffast-math -fno-cx-limited-range -c %s \
163 // RUN: 2>&1 | FileCheck --check-prefix=FULL %s
165 // RUN: %clang -### -target x86_64 -ffast-math -fcomplex-arithmetic=basic -c %s 2>&1 \
166 // RUN: | FileCheck --check-prefix=BASIC %s
168 // RUN: %clang -### -target x86_64 -fcomplex-arithmetic=basic -ffast-math -c %s 2>&1 \
169 // RUN: | FileCheck --check-prefix=BASIC %s
171 // RUN: %clang -### -Werror -target x86_64 -fcx-limited-range -c %s 2>&1 \
172 // RUN: | FileCheck --check-prefix=BASIC %s
174 // RUN: %clang -### -target x86_64 -ffast-math -fcomplex-arithmetic=full -c %s 2>&1 \
175 // RUN: | FileCheck --check-prefix=FULL %s
177 // RUN: %clang -### -target x86_64 -ffast-math -fcomplex-arithmetic=basic -c %s 2>&1 \
178 // RUN: | FileCheck --check-prefix=BASIC %s
180 // BASIC: -complex-range=basic
181 // FULL: -complex-range=full
182 // PRMTD: -complex-range=promoted
183 // BASIC-NOT: -complex-range=improved
184 // CHECK-NOT: -complex-range=basic
185 // IMPRVD: -complex-range=improved
186 // IMPRVD-NOT: -complex-range=basic
187 // CHECK-NOT: -complex-range=improved
189 // WARN1: warning: overriding '-fcx-limited-range' option with '-fcx-fortran-rules' [-Woverriding-option]
190 // WARN2: warning: overriding '-fno-cx-limited-range' option with '-fcx-fortran-rules' [-Woverriding-option]
191 // WARN3: warning: overriding '-fcx-fortran-rules' option with '-fno-cx-limited-range' [-Woverriding-option]
192 // WARN4: warning: overriding '-fcx-limited-range' option with '-fno-cx-fortran-rules' [-Woverriding-option]
193 // WARN5: warning: overriding '-fcomplex-arithmetic=basic' option with '-fcomplex-arithmetic=improved' [-Woverriding-option]
194 // WARN6: warning: overriding '-fcx-limited-range' option with '-fcomplex-arithmetic=improved' [-Woverriding-option]
195 // WARN7: warning: overriding '-fcx-fortran-rules' option with '-fcomplex-arithmetic=basic' [-Woverriding-option]
196 // WARN14: overriding '-complex-range=promoted' option with '-fcx-limited-range' [-Woverriding-option]
197 // WARN17: warning: overriding '-fcomplex-arithmetic=full' option with '-fcomplex-arithmetic=basic' [-Woverriding-option]
198 // WARN20: warning: overriding '-fcx-fortran-rules' option with '-fcx-limited-range' [-Woverriding-option]
200 // ERR: error: unsupported argument 'foo' to option '-fcomplex-arithmetic='