1 /* Test DEC_NAN macro.  Runtime exceptions test, to verify NaN is
2    quiet not signaling.  (This would only actually fail for a
3    signaling NaN in the hardware DFP case, because the software DFP
4    support in libgcc does not integrate with hardware exceptions.)  */
5 /* { dg-do run } */
6 /* { dg-require-effective-target fenv_exceptions } */
7 /* { dg-options "-std=c2x" } */
8 
9 #include <fenv.h>
10 #include <float.h>
11 
12 #ifndef DEC_NAN
13 # error "DEC_NAN not defined"
14 #endif
15 
16 volatile _Decimal32 d = DEC_NAN;
17 
18 extern void abort (void);
19 extern void exit (int);
20 
21 int
main(void)22 main (void)
23 {
24   d += d;
25   if (fetestexcept (FE_INVALID))
26     abort ();
27   exit (0);
28 }
29