summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-11 14:44:43 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-11 14:44:43 +0000
commit45844fba558d9cd2d3f302d6075d63341c22c477 (patch)
tree66574671f93758ef60b73e400bdf79190a95ce9f /gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c
parent29583316940d5e79244acf013fb8ce1f772d2c9e (diff)
downloadgcc-45844fba558d9cd2d3f302d6075d63341c22c477.tar.gz
2009-05-11 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r147379 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@147380 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c')
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c39
1 files changed, 39 insertions, 0 deletions
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;
+}