modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c (about)

     1  /* VLAs should be deallocated on a jump to before their definition,
     2     including a jump to a label in an inner scope.  PR 19771.  */
     3  /* { dg-require-effective-target alloca } */
     4  
     5  #if (__SIZEOF_INT__ <= 2)
     6  #define LIMIT 10000
     7  #else
     8  #define LIMIT 1000000
     9  #endif
    10  
    11  void *volatile p;
    12  
    13  int
    14  main (void)
    15  {
    16    int n = 0;
    17    if (0)
    18      {
    19      lab:;
    20      }
    21    int x[n % 1000 + 1];
    22    x[0] = 1;
    23    x[n % 1000] = 2;
    24    p = x;
    25    n++;
    26    if (n < LIMIT)
    27      goto lab;
    28    return 0;
    29  }