summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fixed-point/keywords-reserved.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/fixed-point/keywords-reserved.c')
-rw-r--r--gcc/testsuite/gcc.dg/fixed-point/keywords-reserved.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/fixed-point/keywords-reserved.c b/gcc/testsuite/gcc.dg/fixed-point/keywords-reserved.c
new file mode 100644
index 000000000..63b634982
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fixed-point/keywords-reserved.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1169 6.4.1: Keywords.
+ C99 6.4.1(2): Keywords.
+ Fixed-point keywords cannot be used in other contexts. */
+
+int _Fract (void) /* { dg-error "" } */
+{
+ return 0;
+}
+
+int _Accum (void) /* { dg-error "" } */
+{
+ return 0;
+}
+
+int _Sat (void) /* { dg-error "" } */
+{
+ return 0;
+}
+
+int foo1 (int i)
+{
+ int _Fract = i * 2; /* { dg-error "" } */
+ return _Fract; /* { dg-error "" } */
+}
+
+int foo2 (int i)
+{
+ int _Accum = i * 2; /* { dg-error "" } */
+ return _Accum; /* { dg-error "" } */
+}
+
+int foo3 (int i)
+{
+ int _Sat = i * 2; /* { dg-error "" } */
+ return _Sat; /* { dg-error "" } */
+}