Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.dg / dfp / operator-cond.c
blobff712bda30b832d7157b1fa19d827c315e886c65
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. */
11 #ifdef DBG
12 #include <stdio.h>
13 #define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; }
14 #else
15 #define FAILURE abort ();
16 #endif
18 volatile _Decimal32 d32a, d32b, d32c;
19 volatile _Decimal64 d64a, d64b, d64c;
20 volatile _Decimal128 d128a, d128b, d128c;
21 volatile int i, yes, no;
23 void
24 init ()
26 d32b = 123.456e94df;
27 d64b = 12.3456789012345e383dd;
28 d128b = 12345.6789012345678901e4000dl;
30 d32c = 1.3df;
31 d64c = 1.2dd;
32 d128c = 1.1dl;
34 i = 2;
35 yes = 1;
36 no = 0;
39 int
40 main ()
42 /* Operands and the result are all the same decimal float type. */
43 d32a = yes ? d32b : d32c;
44 if (d32a != d32b)
45 FAILURE
46 d64a = no ? d64b : d64c;
47 if (d64a != d64b)
48 FAILURE
49 d128a = yes ? d128b : d128c;
50 if (d128a != d128b)
51 FAILURE
53 /* Operand types are different. */
54 d128a = yes ? d32b : d64b;
55 if (d128a != d32b)
56 FAILURE
57 d128a = yes ? d128b : d64b;
58 if (d128a != d128b)
59 FAILURE
60 d128a = no ? d32b : d128b;
61 if (d128a != d128b)
62 FAILURE
64 return 0;