annotate gcc/testsuite/gcc.dg/redecl-10.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test for multiple declarations and composite types. Check we don't
kono
parents:
diff changeset
2 ICE with nested initializers. */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
kono
parents:
diff changeset
5 /* { dg-do compile } */
kono
parents:
diff changeset
6 /* { dg-options "-g" } */
kono
parents:
diff changeset
7
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
8 static int w[]; /* { dg-warning "array 'w' assumed to have one element" } */
111
kono
parents:
diff changeset
9 void
kono
parents:
diff changeset
10 f (void)
kono
parents:
diff changeset
11 {
kono
parents:
diff changeset
12 extern int w[] = { 1, 2 }; /* { dg-error "has both" } */
kono
parents:
diff changeset
13 }
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 int x[]; /* { dg-warning "array 'x' assumed to have one element" } */
kono
parents:
diff changeset
16 void
kono
parents:
diff changeset
17 g (void)
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 extern int x[] = { 3, 4, 5 }; /* { dg-error "has both" } */
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
22 static int y[]; /* { dg-warning "array 'y' assumed to have one element" } */
111
kono
parents:
diff changeset
23 void
kono
parents:
diff changeset
24 h (void)
kono
parents:
diff changeset
25 {
kono
parents:
diff changeset
26 extern int y[] = { 6 }; /* { dg-error "has both" } */
kono
parents:
diff changeset
27 }
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 int z[]; /* { dg-warning "array 'z' assumed to have one element" } */
kono
parents:
diff changeset
30 void
kono
parents:
diff changeset
31 i (void)
kono
parents:
diff changeset
32 {
kono
parents:
diff changeset
33 extern int z[] = { 7 }; /* { dg-error "has both" } */
kono
parents:
diff changeset
34 }