(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
array-13.c
       1  /* { dg-do run } */
       2  /* { dg-options "" } */
       3  
       4  /* Verify that GCC's initialized flexible array member extension
       5     works properly.  */
       6  
       7  extern void abort(void);
       8  extern void exit(int);
       9  
      10  typedef int T[];
      11  typedef int T0[0];
      12  
      13  struct f { int w; T x; };
      14  struct g { int w; T0 x; };
      15  
      16  static struct f f = { 4, { 0, 1, 2, 3 } };
      17  static int junk1[] = { -1, -1, -1, -1 };
      18  static struct g g = { 4, { 0, 1, 2, 3 } }; /* { dg-warning "(excess elements)|(near initialization)" } */
      19  static int junk2[] = { -1, -1, -1, -1 };
      20  
      21  int main()
      22  {
      23    int i;
      24    for (i = 0; i < f.w; ++i)
      25      if (f.x[i] != i)
      26        abort ();
      27    exit(0);
      28  }