Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.dg / dfp / operator-comma.c
blob904f9b3a676b89677d77b678ee65a6351a849413
1 /* { dg-options "-std=gnu99 -O0" } */
3 /* C99 6.5.17: Comma 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;
22 void
23 init ()
25 d32b = 123.456e94df;
26 d64b = 12.3456789012345e383dd;
27 d128b = 12345.6789012345678901e4000dl;
29 d32c = 1.3df;
30 d64c = 1.2dd;
31 d128c = 1.1dl;
34 int
35 main ()
37 d32a = (d32b, d32c);
38 if (d32a != d32c)
39 FAILURE
40 d64a = (d64b, 7.89dd, d64c);
41 if (d64a != d64c)
42 FAILURE
43 d128a = (45678.987654dl, d128c, d128b);
44 if (d128a != d128b)
45 FAILURE
46 d128a = (d32b, d64b, d128b);
47 if (d128a != d128b)
48 FAILURE
49 d32a = (d32b, 12, d64c);
50 if (d32a != d64c)
51 FAILURE;
52 d64a = (d64b, d32b, 12);
53 if (d64a != 12.0dd)
54 FAILURE;
56 return 0;