c++: Fix ICE with #embed/RAW_DATA_CST after list conversion [PR118671]
[official-gcc.git] / gcc / testsuite / gcc.dg / dfp / c23-decimal64x-4.c
blobc536ef96b7aaff56af65c926c3ef0479c611b3ef
1 /* Test _Decimal64x in C23 mode - float.h macros. */
2 /* { dg-do run } */
3 /* { dg-options "-std=c23 -pedantic-errors" } */
5 #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
6 #define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
7 #endif
9 #include <float.h>
11 #define expr_has_type(e, t) _Generic (e, default : 0, t : 1)
12 static_assert (expr_has_type (DEC64X_MAX, _Decimal64x));
13 static_assert (expr_has_type (DEC64X_MIN, _Decimal64x));
14 static_assert (expr_has_type (DEC64X_EPSILON, _Decimal64x));
15 static_assert (expr_has_type (DEC64X_TRUE_MIN, _Decimal64x));
17 int
18 main ()
20 #if __DEC64X_MANT_DIG__ == __DEC128_MANT_DIG__ \
21 && __DEC64X_MAX_EXP__ == __DEC128_MAX_EXP__
22 if (DEC64X_MANT_DIG != 34)
23 __builtin_abort ();
25 if (DEC64X_MIN_EXP != -6142)
26 __builtin_abort ();
28 if (DEC64X_MAX_EXP != 6145)
29 __builtin_abort ();
31 if (DEC64X_MAX != 9.999999999999999999999999999999999E6144D64x)
32 __builtin_abort ();
34 if (DEC64X_EPSILON != 1E-33D64x)
35 __builtin_abort ();
37 if (DEC64X_MIN != 1E-6143D64x)
38 __builtin_abort ();
40 if (DEC64X_TRUE_MIN != 0.000000000000000000000000000000001E-6143D64x)
41 __builtin_abort ();
42 #endif