Arm: Fix ldrd offset range [PR115153]
[official-gcc.git] / gcc / testsuite / gcc.dg / dfp / builtin-snan-2.c
blob248481bd371b80a6694c5787c7ac735567dd6a1c
1 /* Test __builtin_nansd* functions. Test requiring runtime exceptions
2 support. */
3 /* { dg-do run } */
4 /* { dg-require-effective-target fenv_exceptions_dfp } */
5 /* { dg-options "" } */
7 #include <fenv.h>
9 volatile _Decimal32 d32 = __builtin_nansd32 ("");
10 volatile _Decimal64 d64 = __builtin_nansd64 ("");
11 volatile _Decimal128 d128 = __builtin_nansd128 ("");
13 extern void abort (void);
14 extern void exit (int);
16 int
17 main (void)
19 feclearexcept (FE_ALL_EXCEPT);
20 d32 += d32;
21 if (!fetestexcept (FE_INVALID))
22 abort ();
23 feclearexcept (FE_ALL_EXCEPT);
24 d32 += d32;
25 if (fetestexcept (FE_INVALID))
26 abort ();
27 feclearexcept (FE_ALL_EXCEPT);
28 d64 += d64;
29 if (!fetestexcept (FE_INVALID))
30 abort ();
31 feclearexcept (FE_ALL_EXCEPT);
32 d64 += d64;
33 if (fetestexcept (FE_INVALID))
34 abort ();
35 feclearexcept (FE_ALL_EXCEPT);
36 d128 += d128;
37 if (!fetestexcept (FE_INVALID))
38 abort ();
39 feclearexcept (FE_ALL_EXCEPT);
40 d128 += d128;
41 if (fetestexcept (FE_INVALID))
42 abort ();
43 exit (0);