aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/declspec-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/declspec-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-1.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-1.c
new file mode 100644
index 000000000..c19f1074e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-1.c
@@ -0,0 +1,27 @@
+/* Test declaration specifiers. Test cases that used to be handled in
+ a loop in grokdeclarator. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+typedef int t;
+
+/* These should all be diagnosed, but only once, not for every
+ identifier declared. */
+struct s0 int x0, /* { dg-error "two or more data types" } */
+x1;
+
+char union u0 x2, /* { dg-error "two or more data types" } */
+x3;
+
+enum e0 struct s1 x4, /* { dg-error "two or more data types" } */
+x5;
+
+short short x6, /* { dg-error "duplicate" } */
+x7;
+
+t int x8, /* { dg-error "two or more data types" } */
+x9;
+
+long long long x10, /* { dg-error "long long long" } */
+x11;