Add qdf24xx base tuning support.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / float128-extendxf-underflow.c
blob228815d38bd6ca41447eae54196f547b1efe79ea
1 /* Test that extension from XFmode to __float128 raises underflow for
2 exact tiny values, if trapping on underflow is enabled. */
4 /* { dg-do run { target i?86-*-*gnu* x86_64-*-*gnu* ia64-*-*gnu* } } */
5 /* { dg-options "-D_GNU_SOURCE" } */
6 /* { dg-require-effective-target fenv_exceptions } */
8 #include <fenv.h>
9 #include <setjmp.h>
10 #include <signal.h>
11 #include <stdlib.h>
13 volatile sig_atomic_t caught_sigfpe;
14 sigjmp_buf buf;
16 static void
17 handle_sigfpe (int sig)
19 caught_sigfpe = 1;
20 siglongjmp (buf, 1);
23 int
24 main (void)
26 volatile long double a = 0x1p-16384L;
27 volatile __float128 r;
28 r = a;
29 if (fetestexcept (FE_UNDERFLOW))
30 abort ();
31 if (r != 0x1p-16384q)
32 abort ();
33 feenableexcept (FE_UNDERFLOW);
34 signal (SIGFPE, handle_sigfpe);
35 if (sigsetjmp (buf, 1) == 0)
36 r = a;
37 if (!caught_sigfpe)
38 abort ();
39 exit (0);