diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/vla-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/vla-1.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vla-1.c b/gcc/testsuite/gcc.dg/vla-1.c new file mode 100644 index 00000000000..56437ae44de --- /dev/null +++ b/gcc/testsuite/gcc.dg/vla-1.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-g -O3 -fdump-tree-optimized -fvar-tracking-assignments -fno-selective-scheduling -fno-selective-scheduling2" } */ + +int __attribute__((noinline)) +f1 (int i) +{ + char a[i + 1]; + char b[i + 2]; + b[1] = 3; + a[0] = 5; + return a[0] + b[1]; +} + +int +main () +{ + volatile int j; + int x = 5; + j = f1 (x); + return 0; +} + +/* One debug source bind is generated for the parameter, and two to describe the + sizes of a and b. */ +/* { dg-final { scan-tree-dump-times " s=> i" 3 "optimized" } } */ |