view gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* { 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;
}