aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c
blob: 3b0777e0f3b25ef2d20fcdf90016c037470f208d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile { target c } } */
/* { dg-options "-fcilkplus -std=c99 -w" } */

int func (int x)
{
  return x++;
}
int main(void)
{
  int argc = 1;
  __asm volatile ("" : "+r" (argc));
  int array[argc];

  array[:] = 5; /* { dg-error "start-index and length fields necessary for using array notations in variable-length arrays." }  */
  array[0:argc] = 5;               /* This is OK.  */
  array[0:5:2] = 5;                /* This is OK.  */
  array[0:argc:2] = 5;             /* This is OK.  */
  array[0:argc:func (argc-2)] = 5; /* This is OK.  */
  return 0;
}