annotate gcc/testsuite/gcc.dg/pr36489.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR c/36489 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-options "-Woverride-init" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 struct A { int a; int b[3]; };
kono
parents:
diff changeset
6 union B { int a; int b[3]; };
kono
parents:
diff changeset
7 int t1[10][10]
kono
parents:
diff changeset
8 = { [1][2] = 11, [1][3] = 12 };
kono
parents:
diff changeset
9 int t2[10][10]
kono
parents:
diff changeset
10 = { [1][2] = 11, [1] = { [3] = 12 } }; /* { dg-warning "initializ" } */
kono
parents:
diff changeset
11 int t3[10][10]
kono
parents:
diff changeset
12 = { [1][2] = 11, [1][2] = 12 }; /* { dg-warning "initializ" } */
kono
parents:
diff changeset
13 struct A t4[2]
kono
parents:
diff changeset
14 = { [0].b[0] = 1, [0].b[1] = 2, [0].b[2] = 3 };
kono
parents:
diff changeset
15 struct A t5[2]
kono
parents:
diff changeset
16 = { [0].b[0] = 1, [0].b[1] = 2, [0].b = { 3 } }; /* { dg-warning "initializ" } */
kono
parents:
diff changeset
17 union B t6
kono
parents:
diff changeset
18 = { .b[0] = 1, .b[1] = 2, .b[2] = 3 };
kono
parents:
diff changeset
19 union B t7
kono
parents:
diff changeset
20 = { .b[0] = 1, .b[1] = 2, .b = { 2 } }; /* { dg-warning "initializ" } */
kono
parents:
diff changeset
21 union B t8
kono
parents:
diff changeset
22 = { .b[0] = 1, .b[1] = 2, .b[1] = 3 }; /* { dg-warning "initializ" } */