aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
blob: f425fbec0f5daa517e749f23f933c0382ebc6136 (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 (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;
}