// expected-note@+1 {{variable with automatic storage duration is predetermined as private; perhaps you forget to enclose 'omp for simd' directive into a parallel or another task region?}}
for(intj=0;j<16;++j)
// expected-error@+2 {{private variable cannot be reduction}}
// expected-error@+1 {{OpenMP constructs may not be nested inside a simd region}}
#pragma omp for simd reduction(+ : i, j)
for(intk=0;k<16;++k)
i+=j;
}
voidtest_linear(){
inti;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd linear(
for(i=0;i<16;++i)
;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd linear(,
for(i=0;i<16;++i)
;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected expression}}
#pragma omp for simd linear(, )
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp for simd linear()
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp for simd linear(int)
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected variable name}}
#pragma omp for simd linear(0)
for(i=0;i<16;++i)
;
// expected-error@+1 {{use of undeclared identifier 'x'}}
#pragma omp for simd linear(x)
for(i=0;i<16;++i)
;
// expected-error@+2 {{use of undeclared identifier 'x'}}
// expected-error@+1 {{use of undeclared identifier 'y'}}
#pragma omp for simd linear(x, y)
for(i=0;i<16;++i)
;
// expected-error@+3 {{use of undeclared identifier 'x'}}
// expected-error@+2 {{use of undeclared identifier 'y'}}
// expected-error@+1 {{use of undeclared identifier 'z'}}
#pragma omp for simd linear(x, y, z)
for(i=0;i<16;++i)
;
intx,y;
// expected-error@+1 {{expected expression}}
#pragma omp for simd linear(x :)
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd linear(x :, )
for(i=0;i<16;++i)
;
#pragma omp for simd linear(x : 1)
for(i=0;i<16;++i)
;
#pragma omp for simd linear(x : 2 * 2)
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd linear(x : 1, y)
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd linear(x : 1, y, z : 1)
for(i=0;i<16;++i)
;
// expected-note@+2 {{defined as linear}}
// expected-error@+1 {{linear variable cannot be linear}}
#pragma omp for simd linear(x) linear(x)
for(i=0;i<16;++i)
;
// expected-note@+2 {{defined as private}}
// expected-error@+1 {{private variable cannot be linear}}
#pragma omp for simd private(x) linear(x)
for(i=0;i<16;++i)
;
// expected-note@+2 {{defined as linear}}
// expected-error@+1 {{linear variable cannot be private}}
#pragma omp for simd linear(x) private(x)
for(i=0;i<16;++i)
;
// expected-warning@+1 {{zero linear step (x and other variables in clause should probably be const)}}
#pragma omp for simd linear(x, y : 0)
for(i=0;i<16;++i)
;
// expected-note@+2 {{defined as linear}}
// expected-error@+1 {{linear variable cannot be lastprivate}}
#pragma omp for simd linear(x) lastprivate(x)
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-note@+2 {{defined as lastprivate}}
// expected-error@+1 {{lastprivate variable cannot be linear}}
#pragma omp for simd lastprivate(x) linear(x)
for(i=0;i<16;++i)
;
}
voidtest_aligned(){
inti;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd aligned(
for(i=0;i<16;++i)
;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd aligned(,
for(i=0;i<16;++i)
;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected expression}}
#pragma omp for simd aligned(, )
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp for simd aligned()
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp for simd aligned(int)
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected variable name}}
#pragma omp for simd aligned(0)
for(i=0;i<16;++i)
;
// expected-error@+1 {{use of undeclared identifier 'x'}}
#pragma omp for simd aligned(x)
for(i=0;i<16;++i)
;
// expected-error@+2 {{use of undeclared identifier 'x'}}
// expected-error@+1 {{use of undeclared identifier 'y'}}
#pragma omp for simd aligned(x, y)
for(i=0;i<16;++i)
;
// expected-error@+3 {{use of undeclared identifier 'x'}}
// expected-error@+2 {{use of undeclared identifier 'y'}}
// expected-error@+1 {{use of undeclared identifier 'z'}}
#pragma omp for simd aligned(x, y, z)
for(i=0;i<16;++i)
;
int*x,y,z[25];// expected-note 4 {{'y' defined here}}
#pragma omp for simd aligned(x)
for(i=0;i<16;++i)
;
#pragma omp for simd aligned(z)
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp for simd aligned(x :)
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd aligned(x :, )
for(i=0;i<16;++i)
;
#pragma omp for simd aligned(x : 1)
for(i=0;i<16;++i)
;
#pragma omp for simd aligned(x : 2 * 2)
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd aligned(x : 1, y)
for(i=0;i<16;++i)
;
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd aligned(x : 1, y, z : 1)
for(i=0;i<16;++i)
;
// expected-error@+1 {{argument of aligned clause should be array or pointer, not 'int'}}
#pragma omp for simd aligned(x, y)
for(i=0;i<16;++i)
;
// expected-error@+1 {{argument of aligned clause should be array or pointer, not 'int'}}
#pragma omp for simd aligned(x, y, z)
for(i=0;i<16;++i)
;
// expected-note@+2 {{defined as aligned}}
// expected-error@+1 {{a variable cannot appear in more than one aligned clause}}
#pragma omp for simd aligned(x) aligned(z, x)
for(i=0;i<16;++i)
;
// expected-note@+3 {{defined as aligned}}
// expected-error@+2 {{a variable cannot appear in more than one aligned clause}}
// expected-error@+1 2 {{argument of aligned clause should be array or pointer, not 'int'}}
#pragma omp for simd aligned(x, y, z) aligned(y, z)
for(i=0;i<16;++i)
;
}
voidtest_private(){
inti;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd private(
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 2 {{expected expression}}
#pragma omp for simd private(,
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 2 {{expected expression}}
#pragma omp for simd private(, )
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 {{expected expression}}
#pragma omp for simd private()
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 {{expected expression}}
#pragma omp for simd private(int)
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 {{expected variable name}}
#pragma omp for simd private(0)
for(i=0;i<16;++i)
;
intx,y,z;
#pragma omp parallel
#pragma omp for simd private(x)
for(i=0;i<16;++i)
;
#pragma omp parallel
#pragma omp for simd private(x, y)
for(i=0;i<16;++i)
;
#pragma omp parallel
#pragma omp for simd private(x, y, z)
for(i=0;i<16;++i){
x=y*i+z;
}
}
voidtest_lastprivate(){
inti;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
#pragma omp for simd lastprivate(
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 2 {{expected expression}}
#pragma omp for simd lastprivate(,
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 2 {{expected expression}}
#pragma omp for simd lastprivate(, )
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 {{expected expression}}
#pragma omp for simd lastprivate()
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 {{expected expression}}
#pragma omp for simd lastprivate(int)
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 {{expected variable name}}
#pragma omp for simd lastprivate(0)
for(i=0;i<16;++i)
;
intx,y,z;
#pragma omp parallel
#pragma omp for simd lastprivate(x)
for(i=0;i<16;++i)
;
#pragma omp parallel
#pragma omp for simd lastprivate(x, y)
for(i=0;i<16;++i)
;
#pragma omp parallel
#pragma omp for simd lastprivate(x, y, z)
for(i=0;i<16;++i)
;
}
voidtest_firstprivate(){
inti;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
#pragma omp for simd firstprivate(
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 2 {{expected expression}}
#pragma omp for simd firstprivate(,
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 2 {{expected expression}}
#pragma omp for simd firstprivate(, )
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 {{expected expression}}
#pragma omp for simd firstprivate()
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 {{expected expression}}
#pragma omp for simd firstprivate(int)
for(i=0;i<16;++i)
;
#pragma omp parallel
// expected-error@+1 {{expected variable name}}
#pragma omp for simd firstprivate(0)
for(i=0;i<16;++i)
;
intx,y,z;
#pragma omp parallel
#pragma omp for simd lastprivate(x) firstprivate(x)
for(i=0;i<16;++i)
;
#pragma omp parallel
#pragma omp for simd lastprivate(x, y) firstprivate(x, y)
for(i=0;i<16;++i)
;
#pragma omp parallel
#pragma omp for simd lastprivate(x, y, z) firstprivate(x, y, z)
for(i=0;i<16;++i)
;
}
voidtest_loop_messages(){
floata[100],b[100],c[100];
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp for 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 pointer type}}