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.
10 Use _Pragma rather than #pragma. */
12 _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
13 double a
= 1.0 * 2.0dd
;
18 _Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
19 double b
= 2.0 * 3.0d
;
22 double c
= 3.0 * 4.0d
;
27 _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
28 double d
= 4.0 * 5.0dd
;
35 _Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT")
36 double e
= 5.0 * 6.0d
;
46 /* Use value from outer scope, which is ON. */
47 double b
= 2.0 * 3.0dd
;
50 _Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
51 double c
= 3.0 * 4.0d
;
54 _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
55 double d
= 4.0 * 5.0dd
;
58 _Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT")
59 double e
= 5.0 * 6.0d
;
62 _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
63 double f
= 6.0 * 7.0dd
;
65 b
= a
+ b
+ c
+ d
+ e
+ f
;
73 /* Use previous value from this scope, which is ON. */
74 double f
= 6.0 * 7.0dd
;
79 _Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
80 double b
= 2.0 * 3.0d
;
85 /* Return to the state from this scope, which is ON. */
86 double g
= 7.0 + 8.0dd
;