#pragma omp taskloop allocate(omp_thread_mem_alloc: argc) firstprivate(argc) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'taskloop' directive}}
#pragma omp taskloop firstprivate(z, e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
#pragma omp taskloop firstprivate(i) // expected-note 2 {{defined as firstprivate}}
for(i=0;i<argc;++i)// expected-error 2 {{loop iteration variable in the associated loop of 'omp taskloop' directive may not be firstprivate, predetermined as private}}
#pragma omp taskloop firstprivate(i) // expected-note {{defined as firstprivate}} expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
for(i=0;i<argc;++i)// expected-error {{loop iteration variable in the associated loop of 'omp taskloop' directive may not be firstprivate, predetermined as private}}
foo();
return0;
}
voidbar(S4a[2]){
#pragma omp parallel
#pragma omp taskloop firstprivate(a)
for(inti=0;i<2;++i)
foo();
}
namespaceA{
doublex;
#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
}
namespaceB{
usingA::x;
}
intmain(intargc,char**argv){
constintd=5;
constintda[5]={0};
S4e(4);
S5g(5);
S3m;
S6n(2);
inti;
int&j=i;
#pragma omp parallel
#pragma omp taskloop firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for(i=0;i<argc;++i)
foo();
#pragma omp parallel
#pragma omp taskloop firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp taskloop firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
for(i=0;i<argc;++i)
foo();
#pragma omp parallel
#pragma omp taskloop firstprivate(m) // OK
for(i=0;i<argc;++i)
foo();
#pragma omp parallel
#pragma omp taskloop firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
for(i=0;i<argc;++i)
foo();
#pragma omp parallel
#pragma omp taskloop private(xa), firstprivate(xa) // expected-error {{private variable cannot be firstprivate}} expected-note {{defined as private}}
for(i=0;i<argc;++i)
foo();
#pragma omp parallel
#pragma omp taskloop firstprivate(i) // expected-note {{defined as firstprivate}}
for(i=0;i<argc;++i)// expected-error {{loop iteration variable in the associated loop of 'omp taskloop' directive may not be firstprivate, predetermined as private}}
foo();
#pragma omp parallel shared(xa)
#pragma omp taskloop firstprivate(xa) // OK: may be firstprivate
for(i=0;i<argc;++i)
foo();
#pragma omp parallel
#pragma omp taskloop firstprivate(j)
for(i=0;i<argc;++i)
foo();
#pragma omp parallel
#pragma omp taskloop lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}}
for(i=0;i<argc;++i)
foo();
#pragma omp parallel
#pragma omp taskloop lastprivate(n) firstprivate(n) // OK
for(i=0;i<argc;++i)
foo();
#pragma omp parallel
{
intv=0;
inti;
#pragma omp taskloop firstprivate(i)
for(intk=0;k<argc;++k){
i=k;
v+=i;
}
}
#pragma omp parallel private(i)
#pragma omp taskloop firstprivate(i) // expected-note {{defined as firstprivate}}
for(i=0;i<argc;++i)// expected-error {{loop iteration variable in the associated loop of 'omp taskloop' directive may not be firstprivate, predetermined as private}}
#pragma omp taskloop firstprivate(i) //expected-error {{argument of a reduction clause of a parallel construct must not appear in a firstprivate clause on a task construct}}
#pragma omp taskloop firstprivate(i) //expected-note {{defined as firstprivate}}
for(i=0;i<argc;++i)// expected-error {{loop iteration variable in the associated loop of 'omp taskloop' directive may not be firstprivate, predetermined as private}}