// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp target parallel for
for(ii=0;ii<10;++jj)
c[ii]=a[jj];
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp target parallel for
for(ii=0;ii<10;++++ii)
c[ii]=a[ii];
// Ok but undefined behavior (in general, cannot check that incr
// is really loop-invariant).
#pragma omp target parallel for
for(ii=0;ii<10;ii=ii+ii)
c[ii]=a[ii];
// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'float'}}
#pragma omp target parallel for
for(ii=0;ii<10;ii=ii+1.0f)
c[ii]=a[ii];
// Ok - step was converted to integer type.
#pragma omp target parallel for
for(ii=0;ii<10;ii=ii+(int)1.1f)
c[ii]=a[ii];
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp target parallel for
for(ii=0;ii<10;jj=ii+2)
c[ii]=a[ii];
// expected-warning@+3 {{relational comparison result unused}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp target parallel for
for(ii=0;ii<10;jj>kk+2)
c[ii]=a[ii];
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp target parallel for
for(ii=0;ii<10;)
c[ii]=a[ii];
// expected-warning@+3 {{expression result unused}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp target parallel for
for(ii=0;ii<10;!ii)
c[ii]=a[ii];
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp target parallel for
for(ii=0;ii<10;ii?++ii:++jj)
c[ii]=a[ii];
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp target parallel for
for(ii=0;ii<10;ii=ii<10)
c[ii]=a[ii];
// expected-note@+3 {{loop step is expected to be positive due to this condition}}
// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
#pragma omp target parallel for
for(ii=0;ii<10;ii=ii+0)
c[ii]=a[ii];
// expected-note@+3 {{loop step is expected to be positive due to this condition}}
// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
#pragma omp target parallel for
for(ii=0;ii<10;ii=ii+(int)(0.8-0.45))
c[ii]=a[ii];
// expected-note@+3 {{loop step is expected to be positive due to this condition}}
// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
#pragma omp target parallel for
for(ii=0;(ii)<10;ii-=25)
c[ii]=a[ii];
// expected-note@+3 {{loop step is expected to be positive due to this condition}}
// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
#pragma omp target parallel for
for(ii=0;(ii<10);ii-=0)
c[ii]=a[ii];
// expected-note@+3 {{loop step is expected to be negative due to this condition}}
// expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
#pragma omp target parallel for
for(ii=0;ii>10;(ii+=0))
c[ii]=a[ii];
// expected-note@+3 {{loop step is expected to be positive due to this condition}}
// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
#pragma omp target parallel for
for(ii=0;ii<10;(ii)=(1-1)+(ii))
c[ii]=a[ii];
// expected-note@+3 {{loop step is expected to be negative due to this condition}}
// expected-error@+2 {{increment expression must cause 'ii' to decrease on each iteration of OpenMP for loop}}
#pragma omp target parallel for
for((ii=0);ii>10;(ii-=0))
c[ii]=a[ii];
// expected-note@+3 {{loop step is expected to be positive due to this condition}}
// expected-error@+2 {{increment expression must cause 'ii' to increase on each iteration of OpenMP for loop}}
#pragma omp target parallel for
for(ii=0;(ii<10);(ii-=0))
c[ii]=a[ii];
// expected-note@+2 {{defined as firstprivate}}
// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target parallel for' directive may not be firstprivate, predetermined as private}}
#pragma omp target parallel for firstprivate(ii)
for(ii=0;ii<10;ii++)
c[ii]=a[ii];
// expected-note@+2 {{defined as linear}}
// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target parallel for' directive may not be linear, predetermined as private}}
#pragma omp target parallel for linear(ii)
for(ii=0;ii<10;ii++)
c[ii]=a[ii];
#pragma omp target parallel for private(ii)
for(ii=0;ii<10;ii++)
c[ii]=a[ii];
#pragma omp target parallel for lastprivate(ii)
for(ii=0;ii<10;ii++)
c[ii]=a[ii];
{
// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target parallel for' directive may not be threadprivate or thread local, predetermined as private}}
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}