| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O1 -funroll-loops" } */ |
| 3 |
/* { dg-add-options ieee } */ |
| 4 |
|
| 5 |
extern void exit (int); |
| 6 |
extern void abort (void); |
| 7 |
|
| 8 |
void |
| 9 |
compare (double a, double b) |
| 10 |
{ |
| 11 |
do |
| 12 |
{ |
| 13 |
double s1 = __builtin_copysign ((double) 1.0, a); |
| 14 |
double s2 = __builtin_copysign ((double) 1.0, b); |
| 15 |
|
| 16 |
if (s1 != s2) |
| 17 |
abort (); |
| 18 |
|
| 19 |
if ((__builtin_isnan (a) != 0) != (__builtin_isnan (b) != 0)) |
| 20 |
abort (); |
| 21 |
|
| 22 |
if ((a != b) != (__builtin_isnan (a) != 0)) |
| 23 |
abort (); |
| 24 |
} while (0); |
| 25 |
} |
| 26 |
|
| 27 |
int |
| 28 |
main () |
| 29 |
{ |
| 30 |
double a = 0.0; |
| 31 |
double b = 0.0; |
| 32 |
_Complex double cr = __builtin_complex (a, b); |
| 33 |
static _Complex double cs = __builtin_complex (0.0, 0.0); |
| 34 |
|
| 35 |
compare (__real__ cr, 0.0); |
| 36 |
compare (__imag__ cr, 0.0); |
| 37 |
compare (__real__ cs, 0.0); |
| 38 |
compare (__imag__ cs, 0.0); |
| 39 |
|
| 40 |
exit (0); |
| 41 |
} |