2 /* { dg-options "-std=gnu99" } */
4 /* C99 6.5.4 Cast operators.
5 Test valid casts involving decimal float. */
7 extern void abort (void);
14 static double d = 2.l;
19 /* Casts between DFP types. */
24 if (d32 != (_Decimal32) d64)
26 if (d32 != (_Decimal32) d128)
29 if (d64 != (_Decimal64) d32)
31 if (d64 != (_Decimal64) d128)
34 if (d128 != (_Decimal128) d32)
36 if (d128 != (_Decimal128) d64)
39 /* Casts between generic and decimal floating point types. Use a
40 value that we can assume can be represented exactly in all
47 /* To generic floating types. */
48 if ((float) d32 != 2.0f)
50 if ((double) d32 != 2.0l)
52 if ((float) d64 != 2.0f)
54 if ((double) d64 != 2.0l)
56 if ((float) d128 != 2.0f)
58 if ((double) d128 != 2.0l)
61 /* float to decimal floating types. */
62 if (d32 != (_Decimal32) f)
64 if (d64 != (_Decimal64) f)
66 if (d128 != (_Decimal128) f)
69 /* double to decimal floating types. */
70 if (d32 != (_Decimal32) d)
72 if (d64 != (_Decimal64) d)
74 if (d128 != (_Decimal128) d)