comparison gcc/testsuite/c-c++-common/dfp/operator-comma.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
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 init ();
28
29 d32a = (d32b, d32c);
30 if (d32a != d32c)
31 FAILURE
32 d64a = (d64b, 7.89dd, d64c);
33 if (d64a != d64c)
34 FAILURE
35 d128a = (45678.987654dl, d128c, d128b);
36 if (d128a != d128b)
37 FAILURE
38 d128a = (d32b, d64b, d128b);
39 if (d128a != d128b)
40 FAILURE
41 d32a = (d32b, 12, d64c);
42 if (d32a != d64c)
43 FAILURE;
44 d64a = (d64b, d32b, 12);
45 if (d64a != 12.0dd)
46 FAILURE;
47
48 FINISH
49 }