// Currently, we cannot use "0" for global register variables.
// register int reg0 __asm__("0");
intreg0;
inttest_iteration_spaces(){
constintN=100;
floata[N],b[N],c[N];
intii,jj,kk;
floatfii;
doubledii;
registerintreg;// expected-warning {{'register' storage class specifier is deprecated}}
#pragma omp parallel
#pragma omp taskloop simd
for(inti=0;i<10;i+=1){
c[i]=a[i]+b[i];
}
#pragma omp parallel
#pragma omp taskloop simd
for(chari=0;i<10;i++){
c[i]=a[i]+b[i];
}
#pragma omp parallel
#pragma omp taskloop simd
for(chari=0;i<10;i+='\1'){
c[i]=a[i]+b[i];
}
#pragma omp parallel
#pragma omp taskloop simd
for(longlongi=0;i<10;i++){
c[i]=a[i]+b[i];
}
#pragma omp parallel
// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'double'}}
#pragma omp taskloop simd
for(longlongi=0;i<10;i+=1.5){
c[i]=a[i]+b[i];
}
#pragma omp parallel
#pragma omp taskloop simd
for(longlongi=0;i<'z';i+=1u){
c[i]=a[i]+b[i];
}
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or random access iterator type}}
#pragma omp taskloop simd
for(floatfi=0;fi<10.0;fi++){
c[(int)fi]=a[(int)fi]+b[(int)fi];
}
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or random access iterator type}}
#pragma omp taskloop simd
for(doublefi=0;fi<10.0;fi++){
c[(int)fi]=a[(int)fi]+b[(int)fi];
}
#pragma omp parallel
// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp taskloop simd
for(int&ref=ii;ref<10;ref++){
}
#pragma omp parallel
// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp taskloop simd
for(inti;i<10;i++)
c[i]=a[i];
#pragma omp parallel
// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp taskloop simd
for(inti=0,j=0;i<10;++i)
c[i]=a[i];
#pragma omp parallel
// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp taskloop simd
for(;ii<10;++ii)
c[ii]=a[ii];
#pragma omp parallel
// expected-warning@+3 {{expression result unused}}
// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp taskloop simd
for(ii+1;ii<10;++ii)
c[ii]=a[ii];
#pragma omp parallel
// expected-error@+2 {{initialization clause of OpenMP for loop is not in canonical form ('var = init' or 'T var = init')}}
#pragma omp taskloop simd
for(c[ii]=0;ii<10;++ii)
c[ii]=a[ii];
#pragma omp parallel
// Ok to skip parenthesises.
#pragma omp taskloop simd
for(((ii))=0;ii<10;++ii)
c[ii]=a[ii];
#pragma omp parallel
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp taskloop simd
for(inti=0;i;i++)
c[i]=a[i];
#pragma omp parallel
// expected-error@+3 {{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 'i'}}
#pragma omp taskloop simd
for(inti=0;jj<kk;ii++)
c[i]=a[i];
#pragma omp parallel
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp taskloop simd
for(inti=0;!!i;i++)
c[i]=a[i];
#pragma omp parallel
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp taskloop simd
for(inti=0;i!=1;i++)
c[i]=a[i];
#pragma omp parallel
// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp taskloop simd
for(inti=0;;i++)
c[i]=a[i];
#pragma omp parallel
// Ok.
#pragma omp taskloop simd
for(inti=11;i>10;i--)
c[i]=a[i];
#pragma omp parallel
// Ok.
#pragma omp taskloop simd
for(inti=0;i<10;++i)
c[i]=a[i];
#pragma omp parallel
// Ok.
#pragma omp taskloop simd
for(ii=0;ii<10;++ii)
c[ii]=a[ii];
#pragma omp parallel
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp taskloop simd
for(ii=0;ii<10;++jj)
c[ii]=a[jj];
#pragma omp parallel
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp taskloop simd
for(ii=0;ii<10;++++ii)
c[ii]=a[ii];
#pragma omp parallel
// Ok but undefined behavior (in general, cannot check that incr
// is really loop-invariant).
#pragma omp taskloop simd
for(ii=0;ii<10;ii=ii+ii)
c[ii]=a[ii];
#pragma omp parallel
// expected-error@+2 {{expression must have integral or unscoped enumeration type, not 'float'}}
#pragma omp taskloop simd
for(ii=0;ii<10;ii=ii+1.0f)
c[ii]=a[ii];
#pragma omp parallel
// Ok - step was converted to integer type.
#pragma omp taskloop simd
for(ii=0;ii<10;ii=ii+(int)1.1f)
c[ii]=a[ii];
#pragma omp parallel
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp taskloop simd
for(ii=0;ii<10;jj=ii+2)
c[ii]=a[ii];
#pragma omp parallel
// 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 taskloop simd
for(ii=0;ii<10;jj>kk+2)
c[ii]=a[ii];
#pragma omp parallel
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp taskloop simd
for(ii=0;ii<10;)
c[ii]=a[ii];
#pragma omp parallel
// 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 taskloop simd
for(ii=0;ii<10;!ii)
c[ii]=a[ii];
#pragma omp parallel
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp taskloop simd
for(ii=0;ii<10;ii?++ii:++jj)
c[ii]=a[ii];
#pragma omp parallel
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'ii'}}
#pragma omp taskloop simd
for(ii=0;ii<10;ii=ii<10)
c[ii]=a[ii];
#pragma omp parallel
// 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 taskloop simd
for(ii=0;ii<10;ii=ii+0)
c[ii]=a[ii];
#pragma omp parallel
// 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 taskloop simd
for(ii=0;ii<10;ii=ii+(int)(0.8-0.45))
c[ii]=a[ii];
#pragma omp parallel
// 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 taskloop simd
for(ii=0;(ii)<10;ii-=25)
c[ii]=a[ii];
#pragma omp parallel
// 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 taskloop simd
for(ii=0;(ii<10);ii-=0)
c[ii]=a[ii];
#pragma omp parallel
// 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 taskloop simd
for(ii=0;ii>10;(ii+=0))
c[ii]=a[ii];
#pragma omp parallel
// 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 taskloop simd
for(ii=0;ii<10;(ii)=(1-1)+(ii))
c[ii]=a[ii];
#pragma omp parallel
// 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 taskloop simd
for((ii=0);ii>10;(ii-=0))
c[ii]=a[ii];
#pragma omp parallel
// 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 taskloop simd
for(ii=0;(ii<10);(ii-=0))
c[ii]=a[ii];
#pragma omp parallel
// expected-note@+2 {{defined as firstprivate}}
// expected-error@+2 {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be firstprivate, predetermined as linear}}
#pragma omp taskloop simd firstprivate(ii)
for(ii=0;ii<10;ii++)
c[ii]=a[ii];
#pragma omp parallel
#pragma omp taskloop simd linear(ii)
for(ii=0;ii<10;ii++)
c[ii]=a[ii];
// expected-note@+3 {{defined as private}}
// expected-error@+3 {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be private, predetermined as linear}}
#pragma omp parallel
#pragma omp taskloop simd private(ii)
for(ii=0;ii<10;ii++)
c[ii]=a[ii];
// expected-note@+3 {{defined as lastprivate}}
// expected-error@+3 {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be lastprivate, predetermined as linear}}
// expected-error@+2 {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be threadprivate or thread local, predetermined as linear}}