1// RUN: %clang_builtins %s %librt -o %t && %run %t
2// REQUIRES: librt_has_comparedf2
3
4#include <stdio.h>
5
6int __eqdf2(double, double);
7int __gedf2(double, double);
8int __gtdf2(double, double);
9int __ledf2(double, double);
10int __ltdf2(double, double);
11int __nedf2(double, double);
12int __unorddf2(double, double);
13
14struct TestVector {
15 double a;
16 double b;
17 int eqReference;
18 int geReference;
19 int gtReference;
20 int leReference;
21 int ltReference;
22 int neReference;
23 int unReference;
24};
25
26int test__cmpdf2(const struct TestVector *vector) {
27
28 if (__eqdf2(vector->a, vector->b) != vector->eqReference) {
29 printf("error in __eqdf2(%a, %a) = %d, expected %d\n",
30 vector->a, vector->b,
31 __eqdf2(vector->a, vector->b),
32 vector->eqReference);
33 return 1;
34 }
35
36 if (__gedf2(vector->a, vector->b) != vector->geReference) {
37 printf("error in __gedf2(%a, %a) = %d, expected %d\n",
38 vector->a, vector->b,
39 __gedf2(vector->a, vector->b),
40 vector->geReference);
41 return 1;
42 }
43
44 if (__gtdf2(vector->a, vector->b) != vector->gtReference) {
45 printf("error in __gtdf2(%a, %a) = %d, expected %d\n",
46 vector->a, vector->b,
47 __gtdf2(vector->a, vector->b),
48 vector->gtReference);
49 return 1;
50 }
51
52 if (__ledf2(vector->a, vector->b) != vector->leReference) {
53 printf("error in __ledf2(%a, %a) = %d, expected %d\n",
54 vector->a, vector->b,
55 __ledf2(vector->a, vector->b),
56 vector->leReference);
57 return 1;
58 }
59
60 if (__ltdf2(vector->a, vector->b) != vector->ltReference) {
61 printf("error in __ltdf2(%a, %a) = %d, expected %d\n",
62 vector->a, vector->b,
63 __ltdf2(vector->a, vector->b),
64 vector->ltReference);
65 return 1;
66 }
67
68 if (__nedf2(vector->a, vector->b) != vector->neReference) {
69 printf("error in __nedf2(%a, %a) = %d, expected %d\n",
70 vector->a, vector->b,
71 __nedf2(vector->a, vector->b),
72 vector->neReference);
73 return 1;
74 }
75
76 if (__unorddf2(vector->a, vector->b) != vector->unReference) {
77 printf("error in __unorddf2(%a, %a) = %d, expected %d\n",
78 vector->a, vector->b,
79 __unorddf2(vector->a, vector->b),
80 vector->unReference);
81 return 1;
82 }
83
84 return 0;
85}
86
87/*
88void generateVectors() {
89
90 const double arguments[] = {
91 __builtin_nan(""),
92 -__builtin_inf(),
93 -0x1.fffffffffffffp1023,
94 -0x1.0000000000001p0
95 -0x1.0000000000000p0,
96 -0x1.fffffffffffffp-1,
97 -0x1.0000000000000p-1022,
98 -0x0.fffffffffffffp-1022,
99 -0x0.0000000000001p-1022,
100 -0.0,
101 0.0,
102 0x0.0000000000001p-1022,
103 0x0.fffffffffffffp-1022,
104 0x1.0000000000000p-1022,
105 0x1.fffffffffffffp-1,
106 0x1.0000000000000p0,
107 0x1.0000000000001p0,
108 0x1.fffffffffffffp1023,
109 __builtin_inf()
110 };
111
112 int numArguments = sizeof arguments / sizeof arguments[0];
113
114 for (int i=0; i<numArguments; ++i) {
115 for (int j=0; j<numArguments; ++j) {
116 const double a = arguments[i];
117 const double b = arguments[j];
118 const int leResult = a < b ? -1 : a == b ? 0 : 1;
119 const int geResult = a > b ? 1 : a == b ? 0 : -1;
120 const int unResult = a != a || b != b ? 1 : 0;
121 printf("{%a,%a,%d,%d,%d,%d,%d,%d,%d},\n",
122 a, b,
123 leResult,
124 geResult,
125 geResult,
126 leResult,
127 leResult,
128 leResult,
129 unResult);
130 }
131 }
132} */
133
134static const struct TestVector vectors[] = {
135 {__builtin_nan(""),__builtin_nan(""),1,-1,-1,1,1,1,1},
136 {__builtin_nan(""),-__builtin_inf(),1,-1,-1,1,1,1,1},
137 {__builtin_nan(""),-0x1.fffffffffffffp+1023,1,-1,-1,1,1,1,1},
138 {__builtin_nan(""),-0x1p+1,1,-1,-1,1,1,1,1},
139 {__builtin_nan(""),-0x1.fffffffffffffp-1,1,-1,-1,1,1,1,1},
140 {__builtin_nan(""),-0x1p-1022,1,-1,-1,1,1,1,1},
141 {__builtin_nan(""),-0x1.fffffcp-1023,1,-1,-1,1,1,1,1},
142 {__builtin_nan(""),-0x1p-1074,1,-1,-1,1,1,1,1},
143 {__builtin_nan(""),-0x0p+0,1,-1,-1,1,1,1,1},
144 {__builtin_nan(""),0x0p+0,1,-1,-1,1,1,1,1},
145 {__builtin_nan(""),0x1p-1074,1,-1,-1,1,1,1,1},
146 {__builtin_nan(""),0x1.fffffcp-1023,1,-1,-1,1,1,1,1},
147 {__builtin_nan(""),0x1p-1022,1,-1,-1,1,1,1,1},
148 {__builtin_nan(""),0x1.fffffffffffffp-1,1,-1,-1,1,1,1,1},
149 {__builtin_nan(""),0x1p+0,1,-1,-1,1,1,1,1},
150 {__builtin_nan(""),0x1.0000000000001p+0,1,-1,-1,1,1,1,1},
151 {__builtin_nan(""),0x1.fffffffffffffp+1023,1,-1,-1,1,1,1,1},
152 {__builtin_nan(""),__builtin_inf(),1,-1,-1,1,1,1,1},
153 {-__builtin_inf(),__builtin_nan(""),1,-1,-1,1,1,1,1},
154 {-__builtin_inf(),-__builtin_inf(),0,0,0,0,0,0,0},
155 {-__builtin_inf(),-0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
156 {-__builtin_inf(),-0x1p+1,-1,-1,-1,-1,-1,-1,0},
157 {-__builtin_inf(),-0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
158 {-__builtin_inf(),-0x1p-1022,-1,-1,-1,-1,-1,-1,0},
159 {-__builtin_inf(),-0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
160 {-__builtin_inf(),-0x1p-1074,-1,-1,-1,-1,-1,-1,0},
161 {-__builtin_inf(),-0x0p+0,-1,-1,-1,-1,-1,-1,0},
162 {-__builtin_inf(),0x0p+0,-1,-1,-1,-1,-1,-1,0},
163 {-__builtin_inf(),0x1p-1074,-1,-1,-1,-1,-1,-1,0},
164 {-__builtin_inf(),0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
165 {-__builtin_inf(),0x1p-1022,-1,-1,-1,-1,-1,-1,0},
166 {-__builtin_inf(),0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
167 {-__builtin_inf(),0x1p+0,-1,-1,-1,-1,-1,-1,0},
168 {-__builtin_inf(),0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
169 {-__builtin_inf(),0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
170 {-__builtin_inf(),__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
171 {-0x1.fffffffffffffp+1023,__builtin_nan(""),1,-1,-1,1,1,1,1},
172 {-0x1.fffffffffffffp+1023,-__builtin_inf(),1,1,1,1,1,1,0},
173 {-0x1.fffffffffffffp+1023,-0x1.fffffffffffffp+1023,0,0,0,0,0,0,0},
174 {-0x1.fffffffffffffp+1023,-0x1p+1,-1,-1,-1,-1,-1,-1,0},
175 {-0x1.fffffffffffffp+1023,-0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
176 {-0x1.fffffffffffffp+1023,-0x1p-1022,-1,-1,-1,-1,-1,-1,0},
177 {-0x1.fffffffffffffp+1023,-0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
178 {-0x1.fffffffffffffp+1023,-0x1p-1074,-1,-1,-1,-1,-1,-1,0},
179 {-0x1.fffffffffffffp+1023,-0x0p+0,-1,-1,-1,-1,-1,-1,0},
180 {-0x1.fffffffffffffp+1023,0x0p+0,-1,-1,-1,-1,-1,-1,0},
181 {-0x1.fffffffffffffp+1023,0x1p-1074,-1,-1,-1,-1,-1,-1,0},
182 {-0x1.fffffffffffffp+1023,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
183 {-0x1.fffffffffffffp+1023,0x1p-1022,-1,-1,-1,-1,-1,-1,0},
184 {-0x1.fffffffffffffp+1023,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
185 {-0x1.fffffffffffffp+1023,0x1p+0,-1,-1,-1,-1,-1,-1,0},
186 {-0x1.fffffffffffffp+1023,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
187 {-0x1.fffffffffffffp+1023,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
188 {-0x1.fffffffffffffp+1023,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
189 {-0x1p+1,__builtin_nan(""),1,-1,-1,1,1,1,1},
190 {-0x1p+1,-__builtin_inf(),1,1,1,1,1,1,0},
191 {-0x1p+1,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
192 {-0x1p+1,-0x1p+1,0,0,0,0,0,0,0},
193 {-0x1p+1,-0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
194 {-0x1p+1,-0x1p-1022,-1,-1,-1,-1,-1,-1,0},
195 {-0x1p+1,-0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
196 {-0x1p+1,-0x1p-1074,-1,-1,-1,-1,-1,-1,0},
197 {-0x1p+1,-0x0p+0,-1,-1,-1,-1,-1,-1,0},
198 {-0x1p+1,0x0p+0,-1,-1,-1,-1,-1,-1,0},
199 {-0x1p+1,0x1p-1074,-1,-1,-1,-1,-1,-1,0},
200 {-0x1p+1,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
201 {-0x1p+1,0x1p-1022,-1,-1,-1,-1,-1,-1,0},
202 {-0x1p+1,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
203 {-0x1p+1,0x1p+0,-1,-1,-1,-1,-1,-1,0},
204 {-0x1p+1,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
205 {-0x1p+1,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
206 {-0x1p+1,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
207 {-0x1.fffffffffffffp-1,__builtin_nan(""),1,-1,-1,1,1,1,1},
208 {-0x1.fffffffffffffp-1,-__builtin_inf(),1,1,1,1,1,1,0},
209 {-0x1.fffffffffffffp-1,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
210 {-0x1.fffffffffffffp-1,-0x1p+1,1,1,1,1,1,1,0},
211 {-0x1.fffffffffffffp-1,-0x1.fffffffffffffp-1,0,0,0,0,0,0,0},
212 {-0x1.fffffffffffffp-1,-0x1p-1022,-1,-1,-1,-1,-1,-1,0},
213 {-0x1.fffffffffffffp-1,-0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
214 {-0x1.fffffffffffffp-1,-0x1p-1074,-1,-1,-1,-1,-1,-1,0},
215 {-0x1.fffffffffffffp-1,-0x0p+0,-1,-1,-1,-1,-1,-1,0},
216 {-0x1.fffffffffffffp-1,0x0p+0,-1,-1,-1,-1,-1,-1,0},
217 {-0x1.fffffffffffffp-1,0x1p-1074,-1,-1,-1,-1,-1,-1,0},
218 {-0x1.fffffffffffffp-1,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
219 {-0x1.fffffffffffffp-1,0x1p-1022,-1,-1,-1,-1,-1,-1,0},
220 {-0x1.fffffffffffffp-1,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
221 {-0x1.fffffffffffffp-1,0x1p+0,-1,-1,-1,-1,-1,-1,0},
222 {-0x1.fffffffffffffp-1,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
223 {-0x1.fffffffffffffp-1,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
224 {-0x1.fffffffffffffp-1,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
225 {-0x1p-1022,__builtin_nan(""),1,-1,-1,1,1,1,1},
226 {-0x1p-1022,-__builtin_inf(),1,1,1,1,1,1,0},
227 {-0x1p-1022,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
228 {-0x1p-1022,-0x1p+1,1,1,1,1,1,1,0},
229 {-0x1p-1022,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
230 {-0x1p-1022,-0x1p-1022,0,0,0,0,0,0,0},
231 {-0x1p-1022,-0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
232 {-0x1p-1022,-0x1p-1074,-1,-1,-1,-1,-1,-1,0},
233 {-0x1p-1022,-0x0p+0,-1,-1,-1,-1,-1,-1,0},
234 {-0x1p-1022,0x0p+0,-1,-1,-1,-1,-1,-1,0},
235 {-0x1p-1022,0x1p-1074,-1,-1,-1,-1,-1,-1,0},
236 {-0x1p-1022,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
237 {-0x1p-1022,0x1p-1022,-1,-1,-1,-1,-1,-1,0},
238 {-0x1p-1022,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
239 {-0x1p-1022,0x1p+0,-1,-1,-1,-1,-1,-1,0},
240 {-0x1p-1022,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
241 {-0x1p-1022,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
242 {-0x1p-1022,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
243 {-0x1.fffffcp-1023,__builtin_nan(""),1,-1,-1,1,1,1,1},
244 {-0x1.fffffcp-1023,-__builtin_inf(),1,1,1,1,1,1,0},
245 {-0x1.fffffcp-1023,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
246 {-0x1.fffffcp-1023,-0x1p+1,1,1,1,1,1,1,0},
247 {-0x1.fffffcp-1023,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
248 {-0x1.fffffcp-1023,-0x1p-1022,1,1,1,1,1,1,0},
249 {-0x1.fffffcp-1023,-0x1.fffffcp-1023,0,0,0,0,0,0,0},
250 {-0x1.fffffcp-1023,-0x1p-1074,-1,-1,-1,-1,-1,-1,0},
251 {-0x1.fffffcp-1023,-0x0p+0,-1,-1,-1,-1,-1,-1,0},
252 {-0x1.fffffcp-1023,0x0p+0,-1,-1,-1,-1,-1,-1,0},
253 {-0x1.fffffcp-1023,0x1p-1074,-1,-1,-1,-1,-1,-1,0},
254 {-0x1.fffffcp-1023,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
255 {-0x1.fffffcp-1023,0x1p-1022,-1,-1,-1,-1,-1,-1,0},
256 {-0x1.fffffcp-1023,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
257 {-0x1.fffffcp-1023,0x1p+0,-1,-1,-1,-1,-1,-1,0},
258 {-0x1.fffffcp-1023,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
259 {-0x1.fffffcp-1023,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
260 {-0x1.fffffcp-1023,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
261 {-0x1p-1074,__builtin_nan(""),1,-1,-1,1,1,1,1},
262 {-0x1p-1074,-__builtin_inf(),1,1,1,1,1,1,0},
263 {-0x1p-1074,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
264 {-0x1p-1074,-0x1p+1,1,1,1,1,1,1,0},
265 {-0x1p-1074,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
266 {-0x1p-1074,-0x1p-1022,1,1,1,1,1,1,0},
267 {-0x1p-1074,-0x1.fffffcp-1023,1,1,1,1,1,1,0},
268 {-0x1p-1074,-0x1p-1074,0,0,0,0,0,0,0},
269 {-0x1p-1074,-0x0p+0,-1,-1,-1,-1,-1,-1,0},
270 {-0x1p-1074,0x0p+0,-1,-1,-1,-1,-1,-1,0},
271 {-0x1p-1074,0x1p-1074,-1,-1,-1,-1,-1,-1,0},
272 {-0x1p-1074,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
273 {-0x1p-1074,0x1p-1022,-1,-1,-1,-1,-1,-1,0},
274 {-0x1p-1074,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
275 {-0x1p-1074,0x1p+0,-1,-1,-1,-1,-1,-1,0},
276 {-0x1p-1074,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
277 {-0x1p-1074,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
278 {-0x1p-1074,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
279 {-0x0p+0,__builtin_nan(""),1,-1,-1,1,1,1,1},
280 {-0x0p+0,-__builtin_inf(),1,1,1,1,1,1,0},
281 {-0x0p+0,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
282 {-0x0p+0,-0x1p+1,1,1,1,1,1,1,0},
283 {-0x0p+0,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
284 {-0x0p+0,-0x1p-1022,1,1,1,1,1,1,0},
285 {-0x0p+0,-0x1.fffffcp-1023,1,1,1,1,1,1,0},
286 {-0x0p+0,-0x1p-1074,1,1,1,1,1,1,0},
287 {-0x0p+0,-0x0p+0,0,0,0,0,0,0,0},
288 {-0x0p+0,0x0p+0,0,0,0,0,0,0,0},
289 {-0x0p+0,0x1p-1074,-1,-1,-1,-1,-1,-1,0},
290 {-0x0p+0,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
291 {-0x0p+0,0x1p-1022,-1,-1,-1,-1,-1,-1,0},
292 {-0x0p+0,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
293 {-0x0p+0,0x1p+0,-1,-1,-1,-1,-1,-1,0},
294 {-0x0p+0,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
295 {-0x0p+0,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
296 {-0x0p+0,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
297 {0x0p+0,__builtin_nan(""),1,-1,-1,1,1,1,1},
298 {0x0p+0,-__builtin_inf(),1,1,1,1,1,1,0},
299 {0x0p+0,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
300 {0x0p+0,-0x1p+1,1,1,1,1,1,1,0},
301 {0x0p+0,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
302 {0x0p+0,-0x1p-1022,1,1,1,1,1,1,0},
303 {0x0p+0,-0x1.fffffcp-1023,1,1,1,1,1,1,0},
304 {0x0p+0,-0x1p-1074,1,1,1,1,1,1,0},
305 {0x0p+0,-0x0p+0,0,0,0,0,0,0,0},
306 {0x0p+0,0x0p+0,0,0,0,0,0,0,0},
307 {0x0p+0,0x1p-1074,-1,-1,-1,-1,-1,-1,0},
308 {0x0p+0,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
309 {0x0p+0,0x1p-1022,-1,-1,-1,-1,-1,-1,0},
310 {0x0p+0,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
311 {0x0p+0,0x1p+0,-1,-1,-1,-1,-1,-1,0},
312 {0x0p+0,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
313 {0x0p+0,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
314 {0x0p+0,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
315 {0x1p-1074,__builtin_nan(""),1,-1,-1,1,1,1,1},
316 {0x1p-1074,-__builtin_inf(),1,1,1,1,1,1,0},
317 {0x1p-1074,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
318 {0x1p-1074,-0x1p+1,1,1,1,1,1,1,0},
319 {0x1p-1074,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
320 {0x1p-1074,-0x1p-1022,1,1,1,1,1,1,0},
321 {0x1p-1074,-0x1.fffffcp-1023,1,1,1,1,1,1,0},
322 {0x1p-1074,-0x1p-1074,1,1,1,1,1,1,0},
323 {0x1p-1074,-0x0p+0,1,1,1,1,1,1,0},
324 {0x1p-1074,0x0p+0,1,1,1,1,1,1,0},
325 {0x1p-1074,0x1p-1074,0,0,0,0,0,0,0},
326 {0x1p-1074,0x1.fffffcp-1023,-1,-1,-1,-1,-1,-1,0},
327 {0x1p-1074,0x1p-1022,-1,-1,-1,-1,-1,-1,0},
328 {0x1p-1074,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
329 {0x1p-1074,0x1p+0,-1,-1,-1,-1,-1,-1,0},
330 {0x1p-1074,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
331 {0x1p-1074,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
332 {0x1p-1074,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
333 {0x1.fffffcp-1023,__builtin_nan(""),1,-1,-1,1,1,1,1},
334 {0x1.fffffcp-1023,-__builtin_inf(),1,1,1,1,1,1,0},
335 {0x1.fffffcp-1023,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
336 {0x1.fffffcp-1023,-0x1p+1,1,1,1,1,1,1,0},
337 {0x1.fffffcp-1023,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
338 {0x1.fffffcp-1023,-0x1p-1022,1,1,1,1,1,1,0},
339 {0x1.fffffcp-1023,-0x1.fffffcp-1023,1,1,1,1,1,1,0},
340 {0x1.fffffcp-1023,-0x1p-1074,1,1,1,1,1,1,0},
341 {0x1.fffffcp-1023,-0x0p+0,1,1,1,1,1,1,0},
342 {0x1.fffffcp-1023,0x0p+0,1,1,1,1,1,1,0},
343 {0x1.fffffcp-1023,0x1p-1074,1,1,1,1,1,1,0},
344 {0x1.fffffcp-1023,0x1.fffffcp-1023,0,0,0,0,0,0,0},
345 {0x1.fffffcp-1023,0x1p-1022,-1,-1,-1,-1,-1,-1,0},
346 {0x1.fffffcp-1023,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
347 {0x1.fffffcp-1023,0x1p+0,-1,-1,-1,-1,-1,-1,0},
348 {0x1.fffffcp-1023,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
349 {0x1.fffffcp-1023,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
350 {0x1.fffffcp-1023,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
351 {0x1p-1022,__builtin_nan(""),1,-1,-1,1,1,1,1},
352 {0x1p-1022,-__builtin_inf(),1,1,1,1,1,1,0},
353 {0x1p-1022,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
354 {0x1p-1022,-0x1p+1,1,1,1,1,1,1,0},
355 {0x1p-1022,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
356 {0x1p-1022,-0x1p-1022,1,1,1,1,1,1,0},
357 {0x1p-1022,-0x1.fffffcp-1023,1,1,1,1,1,1,0},
358 {0x1p-1022,-0x1p-1074,1,1,1,1,1,1,0},
359 {0x1p-1022,-0x0p+0,1,1,1,1,1,1,0},
360 {0x1p-1022,0x0p+0,1,1,1,1,1,1,0},
361 {0x1p-1022,0x1p-1074,1,1,1,1,1,1,0},
362 {0x1p-1022,0x1.fffffcp-1023,1,1,1,1,1,1,0},
363 {0x1p-1022,0x1p-1022,0,0,0,0,0,0,0},
364 {0x1p-1022,0x1.fffffffffffffp-1,-1,-1,-1,-1,-1,-1,0},
365 {0x1p-1022,0x1p+0,-1,-1,-1,-1,-1,-1,0},
366 {0x1p-1022,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
367 {0x1p-1022,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
368 {0x1p-1022,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
369 {0x1.fffffffffffffp-1,__builtin_nan(""),1,-1,-1,1,1,1,1},
370 {0x1.fffffffffffffp-1,-__builtin_inf(),1,1,1,1,1,1,0},
371 {0x1.fffffffffffffp-1,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
372 {0x1.fffffffffffffp-1,-0x1p+1,1,1,1,1,1,1,0},
373 {0x1.fffffffffffffp-1,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
374 {0x1.fffffffffffffp-1,-0x1p-1022,1,1,1,1,1,1,0},
375 {0x1.fffffffffffffp-1,-0x1.fffffcp-1023,1,1,1,1,1,1,0},
376 {0x1.fffffffffffffp-1,-0x1p-1074,1,1,1,1,1,1,0},
377 {0x1.fffffffffffffp-1,-0x0p+0,1,1,1,1,1,1,0},
378 {0x1.fffffffffffffp-1,0x0p+0,1,1,1,1,1,1,0},
379 {0x1.fffffffffffffp-1,0x1p-1074,1,1,1,1,1,1,0},
380 {0x1.fffffffffffffp-1,0x1.fffffcp-1023,1,1,1,1,1,1,0},
381 {0x1.fffffffffffffp-1,0x1p-1022,1,1,1,1,1,1,0},
382 {0x1.fffffffffffffp-1,0x1.fffffffffffffp-1,0,0,0,0,0,0,0},
383 {0x1.fffffffffffffp-1,0x1p+0,-1,-1,-1,-1,-1,-1,0},
384 {0x1.fffffffffffffp-1,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
385 {0x1.fffffffffffffp-1,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
386 {0x1.fffffffffffffp-1,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
387 {0x1p+0,__builtin_nan(""),1,-1,-1,1,1,1,1},
388 {0x1p+0,-__builtin_inf(),1,1,1,1,1,1,0},
389 {0x1p+0,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
390 {0x1p+0,-0x1p+1,1,1,1,1,1,1,0},
391 {0x1p+0,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
392 {0x1p+0,-0x1p-1022,1,1,1,1,1,1,0},
393 {0x1p+0,-0x1.fffffcp-1023,1,1,1,1,1,1,0},
394 {0x1p+0,-0x1p-1074,1,1,1,1,1,1,0},
395 {0x1p+0,-0x0p+0,1,1,1,1,1,1,0},
396 {0x1p+0,0x0p+0,1,1,1,1,1,1,0},
397 {0x1p+0,0x1p-1074,1,1,1,1,1,1,0},
398 {0x1p+0,0x1.fffffcp-1023,1,1,1,1,1,1,0},
399 {0x1p+0,0x1p-1022,1,1,1,1,1,1,0},
400 {0x1p+0,0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
401 {0x1p+0,0x1p+0,0,0,0,0,0,0,0},
402 {0x1p+0,0x1.0000000000001p+0,-1,-1,-1,-1,-1,-1,0},
403 {0x1p+0,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
404 {0x1p+0,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
405 {0x1.0000000000001p+0,__builtin_nan(""),1,-1,-1,1,1,1,1},
406 {0x1.0000000000001p+0,-__builtin_inf(),1,1,1,1,1,1,0},
407 {0x1.0000000000001p+0,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
408 {0x1.0000000000001p+0,-0x1p+1,1,1,1,1,1,1,0},
409 {0x1.0000000000001p+0,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
410 {0x1.0000000000001p+0,-0x1p-1022,1,1,1,1,1,1,0},
411 {0x1.0000000000001p+0,-0x1.fffffcp-1023,1,1,1,1,1,1,0},
412 {0x1.0000000000001p+0,-0x1p-1074,1,1,1,1,1,1,0},
413 {0x1.0000000000001p+0,-0x0p+0,1,1,1,1,1,1,0},
414 {0x1.0000000000001p+0,0x0p+0,1,1,1,1,1,1,0},
415 {0x1.0000000000001p+0,0x1p-1074,1,1,1,1,1,1,0},
416 {0x1.0000000000001p+0,0x1.fffffcp-1023,1,1,1,1,1,1,0},
417 {0x1.0000000000001p+0,0x1p-1022,1,1,1,1,1,1,0},
418 {0x1.0000000000001p+0,0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
419 {0x1.0000000000001p+0,0x1p+0,1,1,1,1,1,1,0},
420 {0x1.0000000000001p+0,0x1.0000000000001p+0,0,0,0,0,0,0,0},
421 {0x1.0000000000001p+0,0x1.fffffffffffffp+1023,-1,-1,-1,-1,-1,-1,0},
422 {0x1.0000000000001p+0,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
423 {0x1.fffffffffffffp+1023,__builtin_nan(""),1,-1,-1,1,1,1,1},
424 {0x1.fffffffffffffp+1023,-__builtin_inf(),1,1,1,1,1,1,0},
425 {0x1.fffffffffffffp+1023,-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
426 {0x1.fffffffffffffp+1023,-0x1p+1,1,1,1,1,1,1,0},
427 {0x1.fffffffffffffp+1023,-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
428 {0x1.fffffffffffffp+1023,-0x1p-1022,1,1,1,1,1,1,0},
429 {0x1.fffffffffffffp+1023,-0x1.fffffcp-1023,1,1,1,1,1,1,0},
430 {0x1.fffffffffffffp+1023,-0x1p-1074,1,1,1,1,1,1,0},
431 {0x1.fffffffffffffp+1023,-0x0p+0,1,1,1,1,1,1,0},
432 {0x1.fffffffffffffp+1023,0x0p+0,1,1,1,1,1,1,0},
433 {0x1.fffffffffffffp+1023,0x1p-1074,1,1,1,1,1,1,0},
434 {0x1.fffffffffffffp+1023,0x1.fffffcp-1023,1,1,1,1,1,1,0},
435 {0x1.fffffffffffffp+1023,0x1p-1022,1,1,1,1,1,1,0},
436 {0x1.fffffffffffffp+1023,0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
437 {0x1.fffffffffffffp+1023,0x1p+0,1,1,1,1,1,1,0},
438 {0x1.fffffffffffffp+1023,0x1.0000000000001p+0,1,1,1,1,1,1,0},
439 {0x1.fffffffffffffp+1023,0x1.fffffffffffffp+1023,0,0,0,0,0,0,0},
440 {0x1.fffffffffffffp+1023,__builtin_inf(),-1,-1,-1,-1,-1,-1,0},
441 {__builtin_inf(),__builtin_nan(""),1,-1,-1,1,1,1,1},
442 {__builtin_inf(),-__builtin_inf(),1,1,1,1,1,1,0},
443 {__builtin_inf(),-0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
444 {__builtin_inf(),-0x1p+1,1,1,1,1,1,1,0},
445 {__builtin_inf(),-0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
446 {__builtin_inf(),-0x1p-1022,1,1,1,1,1,1,0},
447 {__builtin_inf(),-0x1.fffffcp-1023,1,1,1,1,1,1,0},
448 {__builtin_inf(),-0x1p-1074,1,1,1,1,1,1,0},
449 {__builtin_inf(),-0x0p+0,1,1,1,1,1,1,0},
450 {__builtin_inf(),0x0p+0,1,1,1,1,1,1,0},
451 {__builtin_inf(),0x1p-1074,1,1,1,1,1,1,0},
452 {__builtin_inf(),0x1.fffffcp-1023,1,1,1,1,1,1,0},
453 {__builtin_inf(),0x1p-1022,1,1,1,1,1,1,0},
454 {__builtin_inf(),0x1.fffffffffffffp-1,1,1,1,1,1,1,0},
455 {__builtin_inf(),0x1p+0,1,1,1,1,1,1,0},
456 {__builtin_inf(),0x1.0000000000001p+0,1,1,1,1,1,1,0},
457 {__builtin_inf(),0x1.fffffffffffffp+1023,1,1,1,1,1,1,0},
458 {__builtin_inf(),__builtin_inf(),0,0,0,0,0,0,0},
459};
460
461int main(int argc, char *argv[]) {
462 const int numVectors = sizeof vectors / sizeof vectors[0];
463 int i;
464 for (i = 0; i<numVectors; ++i) {
465 if (test__cmpdf2(&vectors[i])) return 1;
466 }
467 return 0;
468}
469