summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
blob: f4283dbf11fed1dba609707ad588522e875f5cd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-options "-fcilkplus" } */

int main (int argc, char **argv)
{
  extern int func (int);
  int array[10][10], array2[10];

  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;
}