| 1 |
/* PR target/91472 */ |
| 2 |
/* Reported by John Paul Adrian Glaubitz <[email protected]> */ |
| 3 |
/* { dg-require-effective-target double64plus } */ |
| 4 |
|
| 5 |
#if __SIZEOF_INT__ >= 4 |
| 6 |
typedef unsigned int gmp_uint_least32_t; |
| 7 |
#else |
| 8 |
typedef __UINT_LEAST32_TYPE__ gmp_uint_least32_t; |
| 9 |
#endif |
| 10 |
|
| 11 |
union ieee_double_extract |
| 12 |
{ |
| 13 |
struct |
| 14 |
{ |
| 15 |
gmp_uint_least32_t sig:1; |
| 16 |
gmp_uint_least32_t exp:11; |
| 17 |
gmp_uint_least32_t manh:20; |
| 18 |
gmp_uint_least32_t manl:32; |
| 19 |
} s; |
| 20 |
double d; |
| 21 |
}; |
| 22 |
|
| 23 |
double __attribute__((noipa)) |
| 24 |
tests_infinity_d (void) |
| 25 |
{ |
| 26 |
union ieee_double_extract x; |
| 27 |
x.s.exp = 2047; |
| 28 |
x.s.manl = 0; |
| 29 |
x.s.manh = 0; |
| 30 |
x.s.sig = 0; |
| 31 |
return x.d; |
| 32 |
} |
| 33 |
|
| 34 |
int |
| 35 |
main (void) |
| 36 |
{ |
| 37 |
double x = tests_infinity_d (); |
| 38 |
if (x == 0.0) |
| 39 |
__builtin_abort (); |
| 40 |
return 0; |
| 41 |
} |