pr79732.c: Require alias support.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / float128-truncdf-underflow.c
blob83b05387ea002fd5ac6156206c88b8cfae3ad4ac
1 /* Test truncation from __float128 to double uses after-rounding
2 tininess detection. */
4 /* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
5 /* { dg-options "" } */
6 /* { dg-require-effective-target fenv_exceptions } */
8 #include <fenv.h>
9 #include <stdlib.h>
11 int
12 main (void)
14 volatile __float128 a = 0x0.fffffffffffffffp-1022q, b = 0x0.fffffffffffff8p-1022q;
15 volatile double r;
16 r = (double) a;
17 if (fetestexcept (FE_UNDERFLOW))
18 abort ();
19 if (r != 0x1p-1022)
20 abort ();
21 r = (double) b;
22 if (!fetestexcept (FE_UNDERFLOW))
23 abort ();
24 if (r != 0x1p-1022)
25 abort ();
26 exit (0);