diff options
| author | Uneven Prankster <unevenprankster@protonmail.com> | 2023-07-12 13:22:29 -0300 |
|---|---|---|
| committer | Uneven Prankster <unevenprankster@protonmail.com> | 2023-07-12 13:22:29 -0300 |
| commit | fa2bdd711212ba6b7a94a20971e8bfa281e73296 (patch) | |
| tree | 6713b3c0379507d49558287b71dd360ce188a2f0 /tinycc/tests/tests2/122_vla_reuse.c | |
lol
Diffstat (limited to 'tinycc/tests/tests2/122_vla_reuse.c')
| -rw-r--r-- | tinycc/tests/tests2/122_vla_reuse.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tinycc/tests/tests2/122_vla_reuse.c b/tinycc/tests/tests2/122_vla_reuse.c new file mode 100644 index 0000000..feb47de --- /dev/null +++ b/tinycc/tests/tests2/122_vla_reuse.c @@ -0,0 +1,31 @@ +#include <stdio.h> + +int +main (void) +{ + int n = 0; + int first=1; + int *p[101]; + if (0) { + lab:; + } + int x[n % 100 + 1]; + if (first == 0) { + if (&x[0] != p[n % 100 + 1]) { + printf ("ERROR: %p %p\n", &x[0], p[n % 100 + 1]); + return(1); + } + } + else { + p[n % 100 + 1] = &x[0]; + first = n < 100; + } + x[0] = 1; + x[n % 100] = 2; + n++; + if (n < 100000) + goto lab; + printf ("OK\n"); + return 0; +} + |
