summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/simd-1.c
blob: 00aa159eafa8c1296503940abe6f4adb7a0fb941 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int a[32], b[32];

void
foo (void)
{
  int i, j;
  #pragma omp simd linear(i, j) collapse(2)	/* { dg-error "iteration variable 'i' should not be linear" } */
  for (i = 0; i < 32; ++i)			/* { dg-error "iteration variable 'j' should not be linear" "" { target *-*-* } .-1 } */
    for (j = 0; j < 32; ++j)
      a[i] += b[j];
}

void
bar (void)
{
  static int i, j;
  #pragma omp for simd linear(i, j) collapse(2)	/* { dg-error "iteration variable 'i' should not be linear" } */
  for (i = 0; i < 32; ++i)			/* { dg-error "iteration variable 'j' should not be linear" "" { target *-*-* } .-1 } */
    for (j = 0; j < 32; ++j)
      a[i] += b[j];
}