1 /* { dg-options "-std=gnu99 -O0" } */
3 /* C99 6.5.15 Conditional operator.
4 Test with decimal float operands. */
6 extern void abort (void);
7 static int failcnt = 0;
9 /* Support compiling the test to report individual failures; default is
10 to abort as soon as a check fails. */
13 #define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; }
15 #define FAILURE abort ();
18 volatile _Decimal32 d32a, d32b, d32c;
19 volatile _Decimal64 d64a, d64b, d64c;
20 volatile _Decimal128 d128a, d128b, d128c;
21 volatile int i, yes, no;
27 d64b = 12.3456789012345e383dd;
28 d128b = 12345.6789012345678901e4000dl;
42 /* Operands and the result are all the same decimal float type. */
43 d32a = yes ? d32b : d32c;
46 d64a = no ? d64b : d64c;
49 d128a = yes ? d128b : d128c;
53 /* Operand types are different. */
54 d128a = yes ? d32b : d64b;
57 d128a = yes ? d128b : d64b;
60 d128a = no ? d32b : d128b;