* gcc.dg/torture/stackalign/builtin-apply-2.c: Fix skip-if syntax.
[official-gcc.git] / gcc / testsuite / gcc.dg / dfp / pragma-float-const-decimal64-2.c
blob8bc49f771065c197927f3fe8d7d8c3a9f3fec499
1 /* { dg-do compile } */
2 /* { dg-options "-Wall" } */
4 /* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
5 C99 6.4.4.2a (New).
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;
15 double
16 f1 (void)
18 _Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
19 double b = 2.0 * 3.0d;
22 double c = 3.0 * 4.0d;
23 b = b + c;
27 _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
28 double d = 4.0 * 5.0dd;
30 b = b + d;
34 /* Default is OFF. */
35 _Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT")
36 double e = 5.0 * 6.0d;
37 b = b + e;
40 return b;
43 double
44 f2 (void)
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;
70 return b;
73 /* Use previous value from this scope, which is ON. */
74 double f = 6.0 * 7.0dd;
76 double
77 f3 (void)
79 _Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
80 double b = 2.0 * 3.0d;
82 return b + f;
85 /* Return to the state from this scope, which is ON. */
86 double g = 7.0 + 8.0dd;