aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c
diff options
context:
space:
mode:
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.c22
1 files changed, 22 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 00000000000..f2291ad66d4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c
@@ -0,0 +1,22 @@
+/* VLAs should be deallocated on a jump to before their definition,
+ including a jump to a label in an inner scope. PR 19771. */
+
+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 < 1000000)
+ goto lab;
+ return 0;
+}