diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c new file mode 100644 index 000000000..3b0777e0f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target c } } */ +/* { dg-options "-fcilkplus -std=c99 -w" } */ + +int func (int x) +{ + return x++; +} +int main(void) +{ + int argc = 1; + __asm volatile ("" : "+r" (argc)); + int array[argc]; + + array[:] = 5; /* { dg-error "start-index and length fields necessary for using array notations in variable-length arrays." } */ + array[0:argc] = 5; /* This is OK. */ + array[0:5:2] = 5; /* This is OK. */ + array[0:argc:2] = 5; /* This is OK. */ + array[0:argc:func (argc-2)] = 5; /* This is OK. */ + return 0; +} |