c++: trait as typename scope [PR116052]
[official-gcc.git] / gcc / testsuite / gcc.dg / dfp / c23-float-dfp-7.c
blobd08d5460c3131afd9c9c69576e174bbd521ecc18
1 /* Test DEC*_SNAN macros defined in <float.h> with DFP support. */
2 /* { dg-options "-std=c23" } */
4 #include <float.h>
6 #ifndef DEC32_SNAN
7 # error "DEC32_SNAN not defined"
8 #endif
10 #ifndef DEC64_SNAN
11 # error "DEC64_SNAN not defined"
12 #endif
14 #ifndef DEC128_SNAN
15 # error "DEC128_SNAN not defined"
16 #endif
18 volatile _Decimal32 d32 = DEC32_SNAN;
19 volatile _Decimal64 d64 = DEC64_SNAN;
20 volatile _Decimal128 d128 = DEC128_SNAN;
22 extern void abort (void);
23 extern void exit (int);
25 int
26 main (void)
28 (void) _Generic (DEC32_SNAN, _Decimal32 : 0);
29 if (!__builtin_isnan (DEC32_SNAN))
30 abort ();
31 if (!__builtin_isnan (d32))
32 abort ();
33 (void) _Generic (DEC64_SNAN, _Decimal64 : 0);
34 if (!__builtin_isnan (DEC64_SNAN))
35 abort ();
36 if (!__builtin_isnan (d64))
37 abort ();
38 (void) _Generic (DEC128_SNAN, _Decimal128 : 0);
39 if (!__builtin_isnan (DEC128_SNAN))
40 abort ();
41 if (!__builtin_isnan (d128))
42 abort ();
43 exit (0);