annotate gcc/testsuite/gcc.dg/init-desig-obs-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 obsolete forms of designated initializers. Test with default
kono
parents:
diff changeset
2 warning options: valid forms are accepted, while ".member" without
kono
parents:
diff changeset
3 "=" should not be (bug 16667). */
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 "" } */
kono
parents:
diff changeset
7 struct s { int a; };
kono
parents:
diff changeset
8 struct s s0 = { .a = 1 };
kono
parents:
diff changeset
9 struct s s1 = { a: 1 };
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 int x0[] = { [0] = 1 };
kono
parents:
diff changeset
12 int x1[] = { [0] 1 };
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 /* Invalid syntax: multiple designators without "=". */
kono
parents:
diff changeset
15 int x2[2][2] = { [0][0] 1 }; /* { dg-error "syntax error|parse error|expected" } */
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 /* Invalid syntax: C99-style structure designator without "=". */
kono
parents:
diff changeset
19 struct s s2 = { .a 1 }; /* { dg-error "syntax error|parse error|expected" } */