Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / init-desig-obs-1.c
blob52639c86b5be17b2f1b5cb884cf939a5c5446f78
1 /* Test obsolete forms of designated initializers. Test with default
2 warning options: valid forms are accepted, while ".member" without
3 "=" should not be (bug 16667). */
4 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
5 /* { dg-do compile } */
6 /* { dg-options "" } */
7 struct s { int a; };
8 struct s s0 = { .a = 1 };
9 struct s s1 = { a: 1 };
11 int x0[] = { [0] = 1 };
12 int x1[] = { [0] 1 };
14 /* Invalid syntax: multiple designators without "=". */
15 int x2[2][2] = { [0][0] 1 }; /* { dg-error "syntax error|parse error|expected" } */
18 /* Invalid syntax: C99-style structure designator without "=". */
19 struct s s2 = { .a 1 }; /* { dg-error "syntax error|parse error|expected" } */