OSDN Git Service

PR testsuite/41288
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / c-c++-common / dfp / operator-comma.c
1 /* { dg-options "-O0" } */
2
3 /* C99 6.5.17: Comma operator.
4    Test with decimal float operands.  */
5
6 #include "dfp-dbg.h"
7
8 volatile _Decimal32 d32a, d32b, d32c;
9 volatile _Decimal64 d64a, d64b, d64c;
10 volatile _Decimal128 d128a, d128b, d128c;
11
12 void
13 init ()
14 {
15   d32b = 123.456e94df;
16   d64b = 12.3456789012345e383dd;
17   d128b = 12345.6789012345678901e4000dl;
18
19   d32c = 1.3df;
20   d64c = 1.2dd;
21   d128c = 1.1dl;
22 }
23
24 int
25 main ()
26 {
27   d32a = (d32b, d32c);
28   if (d32a != d32c)
29     FAILURE
30   d64a = (d64b, 7.89dd, d64c);
31   if (d64a != d64c)
32     FAILURE
33   d128a = (45678.987654dl, d128c, d128b);
34   if (d128a != d128b)
35     FAILURE
36   d128a = (d32b, d64b, d128b);
37   if (d128a != d128b)
38     FAILURE
39   d32a = (d32b, 12, d64c);
40   if (d32a != d64c)
41     FAILURE;
42   d64a = (d64b, d32b, 12);
43   if (d64a != 12.0dd)
44     FAILURE;
45
46   FINISH
47 }