summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/dfp
diff options
context:
space:
mode:
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-07 22:34:08 +0000
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-07 22:34:08 +0000
commit3ae3a17fa65392ba6c577212dfc4863c24b9d21c (patch)
tree478b0f3a70632c6c119442bb4244b21106b8a03a /gcc/testsuite/gcc.dg/dfp
parentb00f78756b1cd3e6a4dfa2e705b5776b16d1cec2 (diff)
downloadgcc-3ae3a17fa65392ba6c577212dfc4863c24b9d21c.tar.gz
gcc/
PR c/39037 * c-common.h (mark_valid_location_for_stdc_pragma, valid_location_for_stdc_pragma_p, set_float_const_decimal64, clear_float_const_decimal64, float_const_decimal64_p): New. * c.opt (Wunsuffixed-float-constants): New. * c-lex.c (interpret_float): Use pragma FLOAT_CONST_DECIMAL64 for unsuffixed float constant, handle new warning. * c-cppbuiltin.c (c_cpp_builtins): Use cast for double constants. * c-decl.c (c_scope): New flag float_const_decimal64. (set_float_const_decimal64, clear_float_const_decimal64, float_const_decimal64_p): New. (push_scope): Set new flag. * c-parser.c (c_parser_translation_unit): Mark when it's valid to use STDC pragmas. (c_parser_external_declaration): Ditto. (c_parser_compound_statement_nostart): Ditto. * c-pragma.c (valid_location_for_stdc_pragma, mark_valid_location_for_stdc_pragma, valid_location_for_stdc_pragma_p, handle_stdc_pragma, handle_pragma_float_const_decimal64): New. (init_pragma): Register new pragma FLOAT_CONST_DECIMAL64. * cp/semantics.c (valid_location_for_stdc_pragma_p, set_float_const_decimal64, clear_float_const_decimal64, float_const_decimal64_p): New dummy functions. * doc/extend.texi (Decimal Float): Remove statement that the pragma, and suffix for double constants, are not supported. * doc/invoke.texi (Warning Options): List new option. (-Wunsuffixed-float-constants): New. gcc/testsuite PR c/39037 * gcc.dg/Wunsuffixed-float-constants-1.c: New test. * gcc.dg/cpp/pragma-float-const-decimal64-1.c: New test. * gcc.dg/dfp/float-constant-double.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-1.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-2.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-3.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-4.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-5.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-6.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-7.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-8.c: New test. * g++.dg/cpp/pragma-float-const-decimal64-1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147259 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/dfp')
-rw-r--r--gcc/testsuite/gcc.dg/dfp/float-constant-double.c21
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c85
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c86
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c83
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c46
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-5.c46
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-6.c46
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c39
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c174
9 files changed, 626 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/dfp/float-constant-double.c b/gcc/testsuite/gcc.dg/dfp/float-constant-double.c
new file mode 100644
index 00000000000..3f8de656bf6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/float-constant-double.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* Constant float values of type double in <float.h> are suffixed with L
+ and cast to double so they can be used within code that uses pragma
+ FLOAT_CONST_DECIMAL64. If they were not suffixed then use of the macro
+ would have them interpreted as _Decimal64, leading to errors when used
+ in expressions with other operands of type double. */
+
+#include <float.h>
+
+extern double a, b, c, d;
+
+void
+foo ()
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
+ a = 0.1d * DBL_MAX;
+ b = DBL_EPSILON * 10.0d;
+ c = DBL_MIN * 200.0d;
+}
diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c
new file mode 100644
index 00000000000..79fabf34484
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c
@@ -0,0 +1,85 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wall" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Verify that the pragma has the expected result by using unsuffixed
+ float constants as operands in expressions that would mix binary and
+ decimal operands if the pragma had no effect, or the wrong effect. */
+
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+double a = 1.0 * 2.0dd;
+
+double
+f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ double b = 2.0 * 3.0d;
+
+ {
+ double c = 3.0 * 4.0d;
+ b = b + c;
+ }
+
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ double d = 4.0 * 5.0dd;
+
+ b = b + d;
+ }
+
+ {
+ /* Default is OFF. */
+#pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT
+ double e = 5.0 * 6.0d;
+ b = b + e;
+ }
+
+ return b;
+}
+
+double
+f2 (void)
+{
+ /* Use value from outer scope, which is ON. */
+ double b = 2.0 * 3.0dd;
+
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ double c = 3.0 * 4.0d;
+
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ double d = 4.0 * 5.0dd;
+
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT
+ double e = 5.0 * 6.0d;
+
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ double f = 6.0 * 7.0dd;
+
+ b = a + b + c + d + e + f;
+ }
+ }
+ }
+ }
+ return b;
+}
+
+/* Use previous value from this scope, which is ON. */
+double f = 6.0 * 7.0dd;
+
+double
+f3 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ double b = 2.0 * 3.0d;
+
+ return b + f;
+}
+
+/* Return to the state from this scope, which is ON. */
+double g = 7.0 + 8.0dd;
diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c
new file mode 100644
index 00000000000..212748c6c78
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c
@@ -0,0 +1,86 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wall" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Verify that the pragma has the expected result by using unsuffixed
+ float constants as operands in expressions that would mix binary and
+ decimal operands if the pragma had no effect, or the wrong effect.
+ Use _Pragma rather than #pragma. */
+
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
+double a = 1.0 * 2.0dd;
+
+double
+f1 (void)
+{
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
+ double b = 2.0 * 3.0d;
+
+ {
+ double c = 3.0 * 4.0d;
+ b = b + c;
+ }
+
+ {
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
+ double d = 4.0 * 5.0dd;
+
+ b = b + d;
+ }
+
+ {
+ /* Default is OFF. */
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT")
+ double e = 5.0 * 6.0d;
+ b = b + e;
+ }
+
+ return b;
+}
+
+double
+f2 (void)
+{
+ /* Use value from outer scope, which is ON. */
+ double b = 2.0 * 3.0dd;
+
+ {
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
+ double c = 3.0 * 4.0d;
+
+ {
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
+ double d = 4.0 * 5.0dd;
+
+ {
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT")
+ double e = 5.0 * 6.0d;
+
+ {
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
+ double f = 6.0 * 7.0dd;
+
+ b = a + b + c + d + e + f;
+ }
+ }
+ }
+ }
+ return b;
+}
+
+/* Use previous value from this scope, which is ON. */
+double f = 6.0 * 7.0dd;
+
+double
+f3 (void)
+{
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
+ double b = 2.0 * 3.0d;
+
+ return b + f;
+}
+
+/* Return to the state from this scope, which is ON. */
+double g = 7.0 + 8.0dd;
diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c
new file mode 100644
index 00000000000..b9286aac11a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c
@@ -0,0 +1,83 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wall" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New). */
+
+/* Check that defining macros whose names are the same as the tokens used
+ in the pragma doesn't affect use of the pragma. */
+
+#define ON YES
+#define OFF NO
+#define DEFAULT NOPE
+#define STDC OFFICIAL
+#define FLOAT_CONST_DECIMAL64 NEW_PRAGMA
+
+double a;
+
+void
+f1a (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ a = 1.0dd + 2.0;
+}
+
+void
+f1b (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ a = 2.0d + 3.0;
+}
+
+void
+f1c (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT
+ a = 3.0d + 4.0;
+}
+
+/* Check that a macro can be used for the entire pragma. */
+
+#define PRAGMA(x) _Pragma (#x)
+#define DEFAULT_FLOAT_IS_DECIMAL PRAGMA(STDC FLOAT_CONST_DECIMAL64 ON)
+#define DEFAULT_FLOAT_IS_BINARY PRAGMA(STDC FLOAT_CONST_DECIMAL64 OFF)
+
+void
+f2a (void)
+{
+ DEFAULT_FLOAT_IS_DECIMAL
+ a = 5.0 * 6.0dd;
+}
+
+void
+f2b (void)
+{
+ DEFAULT_FLOAT_IS_BINARY
+ a = 6.0 * 7.0d;
+}
+
+/* _Pragma can be used with macros, including the use of a macro for the
+ switch. */
+
+#undef ON
+#undef OFF
+#undef DEFAULT
+#undef STDC
+#undef FLOAT_CONST_DECIMAL64
+
+#define SWITCH ON
+#define FLOAT_CONST_DECIMAL64(x) PRAGMA(STDC FLOAT_CONST_DECIMAL64 x)
+
+void
+f3a (void)
+{
+ FLOAT_CONST_DECIMAL64(SWITCH)
+ a = 1.0 * 7.0dd;
+}
+
+void
+f3b (void)
+{
+ FLOAT_CONST_DECIMAL64(OFF)
+ a = 1.0 + 2.0d;
+}
diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c
new file mode 100644
index 00000000000..86cec1dbd45
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Check that malformed versions of pragma STDC FLOAT_CONST_DECIMAL64
+ are detected. */
+
+double a;
+
+void f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 /* { dg-warning "malformed" } */
+ a = 1.0;
+}
+
+void f2 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 DFP /* { dg-warning "malformed" } */
+ a = 2.0;
+}
+
+void f3 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON DFP /* { dg-warning "junk at end" } */
+ a = 3.0;
+}
+
+void f4 (void)
+{
+ _Pragma ( "STDC FLOAT_CONST_DECIMAL64" ) /* { dg-warning "malformed" } */
+ a = 1.0;
+}
+
+void f5 (void)
+{
+ _Pragma ( "STDC FLOAT_CONST_DECIMAL64 DFP" ) /* { dg-warning "malformed" } */
+ a = 2.0;
+}
+
+void f6 (void)
+{
+ _Pragma ( "STDC FLOAT_CONST_DECIMAL64 ON DFP" ) /* { dg-warning "junk at end" } */
+ a = 3.0;
+}
diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-5.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-5.c
new file mode 100644
index 00000000000..75e9525dda0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-5.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Check that there is a pedantic warning for the use of pragma
+ STD FLOAT_CONST_DECIMAL64. */
+
+double a;
+
+void f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "ISO C" } */
+ a = 1.0;
+}
+
+void f2 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-warning "ISO C" } */
+ a = 2.0;
+}
+
+void f3 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT /* { dg-warning "ISO C" } */
+ a = 3.0;
+}
+
+void f4 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON") /* { dg-warning "ISO C" } */
+ a = 1.0;
+}
+
+void f5 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF") /* { dg-warning "ISO C" } */
+ a = 2.0;
+}
+
+void f6 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT") /* { dg-warning "ISO C" } */
+ a = 3.0;
+}
diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-6.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-6.c
new file mode 100644
index 00000000000..03c1715bee6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-6.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Check that there is a pedantic error for the use of pragma
+ STD FLOAT_CONST_DECIMAL64. */
+
+double a;
+
+void f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "ISO C" } */
+ a = 1.0;
+}
+
+void f2 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-error "ISO C" } */
+ a = 2.0;
+}
+
+void f3 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT /* { dg-error "ISO C" } */
+ a = 3.0;
+}
+
+void f4 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON") /* { dg-error "ISO C" } */
+ a = 1.0;
+}
+
+void f5 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF") /* { dg-error "ISO C" } */
+ a = 2.0;
+}
+
+void f6 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT") /* { dg-error "ISO C" } */
+ a = 3.0;
+}
diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c
new file mode 100644
index 00000000000..7533ee7f0de
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wall" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Check that when pragma FLOAT_CONST_DECIMAL64 is in effect so that
+ unsuffixed constants are _Decimal64, invalid types are still reported
+ as invalid. */
+
+double
+f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ double a = 0x1.0p1;
+ double b = 1.0i;
+
+ return a + b;
+}
+
+double
+f2 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ double a = 0x1.0p1dd; /* { dg-error "with hex" } */
+ double b = 1.0idd; /* { dg-error "invalid suffix" } */
+
+ return a + b;
+}
+
+double
+f3 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ double a = 0x1.0p1; /* Hex constant is not affected by pragma. */
+ double b = 1.0i; /* Imaginary constant is not affected by pragma. */
+
+ return a + b;
+}
diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c
new file mode 100644
index 00000000000..5dbbda5b8f2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c
@@ -0,0 +1,174 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wall" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Pragma STDC FLOAT_CONST_DECIMAL64 "shall occur either outside external
+ declarations or preceding all explicit declarations and statements
+ inside a compound statement." */
+
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+
+#define MAX 200
+
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+
+double a;
+
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+
+struct S1 {
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ int i;
+ int j;
+};
+
+struct S2 {
+ int i;
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ int j;
+};
+
+struct S3 {
+ int i;
+ int j;
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+};
+
+enum E1 {
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
+ one,
+ two
+};
+
+enum E2 {
+ red,
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
+ blue
+};
+
+enum E3 {
+ cat,
+ dog
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
+};
+
+double
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-error "#pragma" } */
+b;
+
+double
+f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ return a;
+}
+
+double
+f2 (void)
+{
+ double b;
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ b = 0.5;
+ return a + b;
+}
+
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+
+double
+f3 (void)
+{
+ typedef double b32;
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ b32 b = 0.5;
+ return b;
+}
+
+double
+f4 (int i)
+{
+top:
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-warning "invalid location" } */
+ if (i == 0)
+ return a;
+ a *= 2.;
+ i = 0;
+ goto top;
+}
+
+double
+f5 (int i)
+{
+ a = a * i;
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-warning "invalid location" } */
+ return a * 2.;
+}
+
+double
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
+f6 (void)
+{
+ return a;
+}
+
+double
+f7
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
+(void) /* { dg-error "before" } */
+{
+ return a;
+}
+
+double
+f8 (void)
+{
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ }
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ return a;
+}
+
+extern void foo9 (void *);
+
+double
+f9 (void)
+{
+ __label__ here;
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ foo9 (&&here);
+here:
+ return a;
+}
+
+double
+f10 (void)
+{
+ void foo10 (void)
+ {
+ a = 1.0;
+ }
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ return a;
+}
+
+double
+f11 (void)
+{
+ __extension__
+ struct A {
+ struct { char a; };
+ char b;
+ };
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ return a;
+}
+
+double
+f12 (void)
+{
+ __extension__ ({ a = 0.5; });
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ return a;
+}