1 /* { dg-do compile } */
2 /* { dg-options "-Wall" } */
4 /* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
7 Verify that the pragma has the expected result by using unsuffixed
8 float constants as operands in expressions that would mix binary and
9 decimal operands if the pragma had no effect, or the wrong effect. */
11 #pragma STDC FLOAT_CONST_DECIMAL64 ON
12 double a
= 1.0 * 2.0dd
;
17 #pragma STDC FLOAT_CONST_DECIMAL64 OFF
18 double b
= 2.0 * 3.0d
;
21 double c
= 3.0 * 4.0d
;
26 #pragma STDC FLOAT_CONST_DECIMAL64 ON
27 double d
= 4.0 * 5.0dd
;
34 #pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT
35 double e
= 5.0 * 6.0d
;
45 /* Use value from outer scope, which is ON. */
46 double b
= 2.0 * 3.0dd
;
49 #pragma STDC FLOAT_CONST_DECIMAL64 OFF
50 double c
= 3.0 * 4.0d
;
53 #pragma STDC FLOAT_CONST_DECIMAL64 ON
54 double d
= 4.0 * 5.0dd
;
57 #pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT
58 double e
= 5.0 * 6.0d
;
61 #pragma STDC FLOAT_CONST_DECIMAL64 ON
62 double f
= 6.0 * 7.0dd
;
64 b
= a
+ b
+ c
+ d
+ e
+ f
;
72 /* Use previous value from this scope, which is ON. */
73 double f
= 6.0 * 7.0dd
;
78 #pragma STDC FLOAT_CONST_DECIMAL64 OFF
79 double b
= 2.0 * 3.0d
;
84 /* Return to the state from this scope, which is ON. */
85 double g
= 7.0 + 8.0dd
;