(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vla-stexp-5.c
       1  /* PR29970 */
       2  /* { dg-do run } */
       3  /* { dg-options "-Wunused-variable" } */
       4  /* { dg-require-effective-target alloca } */
       5  
       6  
       7  
       8  
       9  int foo2a(void)   // should not ICE
      10  {
      11          return ({ int n = 20; struct { int x[n];} x; x.x[12] = 1; sizeof(x); });
      12  }
      13  
      14  
      15  int foo2b(void)   // should not ICE
      16  {
      17          return sizeof *({ int n = 20; struct { int x[n];} x; x.x[12] = 1; &x; });
      18  }
      19  
      20  int main()
      21  {
      22  	if (sizeof(struct { int x[20]; }) != foo2a())
      23  		__builtin_abort();
      24  
      25  	if (sizeof(struct { int x[20]; }) != foo2b())
      26  		__builtin_abort();
      27  
      28  	return 0;
      29  }
      30  
      31