diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/decl-ptr-colon.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/decl-ptr-colon.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/decl-ptr-colon.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/decl-ptr-colon.c new file mode 100644 index 000000000..4b54f4d06 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/decl-ptr-colon.c @@ -0,0 +1,19 @@ +/* { dg-do compile { target c } } */ +/* { dg-options "-fcilkplus" } */ + +int main(void) +{ + extern int func(int); + int array3[:], x, q; /* { dg-error "array notations cannot be used in declaration" } */ + int array3[1:2:x]; /* { dg-error "array notations cannot be used in declaration" } */ + extern char array3[1:func(x)]; /* { dg-error "array notations cannot be used in declaration" } */ + int *a, ***b; + extern char *c; + int array2[10]; + + a[:] = 5; /* { dg-error "start-index and length fields necessary for using array notations in pointers" } */ + c[1:2] = 3; /* This is OK. */ + (array2)[:] = 5; /* This is OK. */ + b[1:2][1:func(x)][:] = 3; /* { dg-error "start-index and length fields necessary for using array notations in pointers" } */ +} + |