* gcc.dg/ucnid-[23456].c: XFAIL on AIX.
[official-gcc.git] / gcc / testsuite / gcc.dg / array-4.c
blobb3e4f6c50dedc8ac4432fe1d9d8ec9c9a8310861
1 /* { dg-do run } */
2 /* { dg-options "" } */
4 /* Verify that GCC's initialized flexible array member extension
5 works properly. */
7 extern void abort(void);
8 extern void exit(int);
10 struct f { int w; int x[]; };
11 struct g { int w; int x[0]; };
13 static struct f f = { 4, { 0, 1, 2, 3 } };
14 static int junk1[] = { -1, -1, -1, -1 };
15 static struct g g = { 4, { 0, 1, 2, 3 } }; /* { dg-warning "(excess elements)|(near initialization)" "" } */
16 static int junk2[] = { -1, -1, -1, -1 };
18 int main()
20 int i;
21 for (i = 0; i < f.w; ++i)
22 if (f.x[i] != i)
23 abort ();
24 exit(0);