aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-2.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-2.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-2.c
new file mode 100644
index 000000000..2bf661fdc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-2.c
@@ -0,0 +1,24 @@
+/* Test for multiple declarations and composite types. As in bug
+ 13801. Illustrates how bug causes correct code to be wrongly
+ diagnosed. Debug test: avoid ICE. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef int IA[];
+typedef int A5[5];
+typedef int A10[10];
+
+A10 array10;
+
+A5 *ap;
+void
+f (void)
+{
+ int ap;
+ {
+ extern IA *ap;
+ /* This assignment is valid. */
+ ap = &array10;
+ }
+}