diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c b/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c new file mode 100644 index 000000000..9eb95c1b4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c @@ -0,0 +1,28 @@ +/* VLAs should be deallocated on a jump to before their definition, + including a jump to a label in an inner scope. PR 19771. */ + +#if (__SIZEOF_INT__ <= 2) +#define LIMIT 10000 +#else +#define LIMIT 1000000 +#endif + +void *volatile p; + +int +main (void) +{ + int n = 0; + if (0) + { + lab:; + } + int x[n % 1000 + 1]; + x[0] = 1; + x[n % 1000] = 2; + p = x; + n++; + if (n < LIMIT) + goto lab; + return 0; +} |