1 /* { dg-options "-std=gnu99" } */
3 /* C99 6.5.4 Cast operators.
4 Test valid casts involving decimal float. */
6 extern void abort (void);
13 static double d = 2.l;
18 /* Casts between DFP types. */
23 if (d32 != (_Decimal32) d64)
25 if (d32 != (_Decimal32) d128)
28 if (d64 != (_Decimal64) d32)
30 if (d64 != (_Decimal64) d128)
33 if (d128 != (_Decimal128) d32)
35 if (d128 != (_Decimal128) d64)
38 /* Casts between generic and decimal floating point types. Use a
39 value that we can assume can be represented exactly in all
46 /* To generic floating types. */
47 if ((float) d32 != 2.0f)
49 if ((double) d32 != 2.0l)
51 if ((float) d64 != 2.0f)
53 if ((double) d64 != 2.0l)
55 if ((float) d128 != 2.0f)
57 if ((double) d128 != 2.0l)
60 /* float to decimal floating types. */
61 if (d32 != (_Decimal32) f)
63 if (d64 != (_Decimal64) f)
65 if (d128 != (_Decimal128) f)
68 /* double to decimal floating types. */
69 if (d32 != (_Decimal32) d)
71 if (d64 != (_Decimal64) d)
73 if (d128 != (_Decimal128) d)