Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-vla-dealloc-1.c
blob35816544c7f5b685a8c9110d40f80ab5744f588d
1 /*
2 vla-dealloc-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* VLAs should be deallocated on a jump to before their definition,
8 including a jump to a label in an inner scope. PR 19771. */
9 /* { dg-require-effective-target alloca } */
11 #define LIMIT 10000
13 void *volatile p;
15 void
16 testTortureExecute (void)
18 #if 0 // TODO: Enable when SDCC supports VLAs!
19 int n = 0;
20 if (0)
22 lab:;
24 int x[n % 1000 + 1];
25 x[0] = 1;
26 x[n % 1000] = 2;
27 p = x;
28 n++;
29 if (n < LIMIT)
30 goto lab;
31 #endif
32 return;