aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cilk-plus/pragma_simd_tests/execute/vlength_comma.c
blob: 9d870d73369d63ea0f2a3224a0d1dfde9ac274c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* { dg-do run } */
/* { dg-options "-O3 -ftree-vectorize -fcilkplus -w" } */


int a[100];

int
main (int argc, char **argv)
{
  int i;

  for (i = 0; i < 100; i++)
    if (argc == 1) 
      a[i] = 10;
    else
      a[i] = argc * 5;

#pragma simd vectorlength(4, 8)
  for (i = 0; i < 100; i++) 
    a[i] += 1;

  for (i = 0; i < 100; i++)
    if (a[i] != 11)
      return 1;

  return 0;
}