1 /* { dg-options "-std=gnu99" } */
3 /* N1150 5.2 Conversions among decimal floating types and between
4 decimal floating types and generic floating types.
5 C99 6.3.1.5(4) Conversions, arithmetic operands, real floating types. */
7 /* Long double isn't supported yet at runtime, so disable those checks. */
8 #define SKIP_LONG_DOUBLE
10 extern void abort (void);
13 /* Support compiling the test to report individual failures; default is
14 to abort as soon as a check fails. */
17 #define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; }
19 #define FAILURE abort ();
22 volatile _Decimal32 d32;
23 volatile _Decimal64 d64;
24 volatile _Decimal128 d128;
27 #ifndef SKIP_LONG_DOUBLE
28 volatile long double tf;
34 /* Conversions from decimal float to binary float. */
36 /* Conversions from _Decimal32. */
46 #ifndef SKIP_LONG_DOUBLE
52 /* Conversions from _Decimal64. */
62 #ifndef SKIP_LONG_DOUBLE
68 /* Conversions from _Decimal128. */
82 /* Conversions from binary float to decimal float. */
110 #ifndef SKIP_LONG_DOUBLE
125 /* 2**(-11) = 0.00048828125. */
126 d128 = 0.000488281251dl;
128 if (sf != 0.00048828125f)
130 /* 2**(-25) = 0.298023223876953125E-7. */
131 d128 = 2.98023223876953125E-8dl;
133 if (df < (2.9802322387695312e-08 - 0.00000000001)
134 || df > (2.9802322387695312e-08 + 0.00000000001))