aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
new file mode 100644
index 000000000..f425fbec0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
@@ -0,0 +1,19 @@
+/* { dg-options "-fcilkplus" } */
+
+int main (void)
+{
+ extern int func (int);
+ int array[10][10], array2[10];
+ int argc = 1;
+ array2[array[:][:]] = 5; /* { dg-error "rank of the array's index is greater than 1" } */
+
+ array2[array[:][:]] = 5; /* { dg-error "rank of the array's index is greater than 1" } */
+ func (array2[array[:][:]]); /* { dg-error "rank of the array's index is greater than 1" } */
+ func (array2[array[argc:func(5)][0:10:2]]); /* { dg-error "rank of the array's index is greater than 1" } */
+
+ array[array2[:]][array2[:]] = 5; /* This is OK. */
+ array[array2[:]][array2[:]] = array2[array[:][:]]; /* { dg-error "rank of the array's index is greater than 1" } */
+ array[array2[:]][array2[:]] = array2[array[0:10:1][:]]; /* { dg-error "rank of the array's index is greater than 1" } */
+ array[array2[:]][array2[:]] = array2[array[:][argc:func (argc)]]; /* { dg-error "rank of the array's index is greater than 1" } */
+ return 0;
+}