annotate gcc/testsuite/gcc.dg/init-excess-1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test for various cases of excess initializers for empty objects:
kono
parents:
diff changeset
2 bug 21873. Various versions of GCC ICE, hang or loop repeating
kono
parents:
diff changeset
3 diagnostics on various of these tests. */
kono
parents:
diff changeset
4 /* Origin: Joseph Myers <joseph@codesourcery.com> */
kono
parents:
diff changeset
5 /* { dg-do compile } */
kono
parents:
diff changeset
6 /* { dg-options "" } */
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 struct s0 { };
kono
parents:
diff changeset
9 struct s1 { int a; };
kono
parents:
diff changeset
10 struct s2 { int a; int b; };
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 int a0[0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
13 int a1[0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
14 int a2[0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
15 int a3[1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
16 int a4[][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
17 int a5[][0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
18 int a6[][0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
19 int a7[][1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 struct s0 b0[0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
22 struct s0 b1[0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
23 struct s0 b2[0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
24 struct s0 b3[1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
25 struct s0 b4[][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
26 struct s0 b5[][0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
27 struct s0 b6[][0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
28 struct s0 b7[][1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
29 struct s0 b8[1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
30 struct s0 b9[] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 struct s1 c0[0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
33 struct s1 c1[0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
34 struct s1 c2[0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
35 struct s1 c3[1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
36 struct s1 c4[][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
37 struct s1 c5[][0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
38 struct s1 c6[][0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
39 struct s1 c7[][1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 struct s2 d0[0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
42 struct s2 d1[0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
43 struct s2 d2[0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
44 struct s2 d3[1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
45 struct s2 d4[][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
46 struct s2 d5[][0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
47 struct s2 d6[][0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
kono
parents:
diff changeset
48 struct s2 d7[][1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */