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

typedef int (*foo)(int);

int main(void)
{
  int array[10], array2[10][10];
  foo func_array[10];
  foo func_array2[10][10];
  foo ***func_array_ptr;
  int argc = 5;

  array[:] =  func_array[:](10); /* { dg-error "array notations cannot be used with function pointer arrays" } */
  func_array[0:5](10); /* { dg-error "array notations cannot be used with function pointer arrays" } */
  func_array2[0:5][:](10); /* { dg-error "array notations cannot be used with function pointer arrays" } */
  array2[0:5][:] = func_array2[0:5][:](10); /* { dg-error "array notations cannot be used with function pointer arrays" } */
  func_array_ptr[0:5][0:4][0:argc:2](argc); /* { dg-error "array notations cannot be used with function pointer arrays" } */

  return 0;
}