view gcc/testsuite/g++.dg/gomp/simd-2.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

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" "" { target *-*-* } .+1 }
  for (i = 0; i < 32; ++i)			// { dg-error "iteration variable 'j' should not be linear" }
    for (j = 0; j < 32; ++j)
      a[i] += b[j];
}