summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/redecl-7.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/redecl-7.c')
-rw-r--r--gcc/testsuite/gcc.dg/redecl-7.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/redecl-7.c b/gcc/testsuite/gcc.dg/redecl-7.c
new file mode 100644
index 000000000..6168562ca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/redecl-7.c
@@ -0,0 +1,23 @@
+/* Test for multiple declarations and composite types. Diagnosis of
+ completion incompatible with implicit initializer. */
+
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+int x[];
+
+void
+f (void)
+{
+ extern int x[2]; /* { dg-error "completed incompatibly" } */
+}
+
+/* The following is OK. */
+
+int y[];
+void
+g (void)
+{
+ extern int y[1];
+}