#pragma omp target teams map(marr[2][0:2][0:2]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr[:][0:][:])
{}
#pragma omp target teams map(marr[:][1:][:]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr[:][n:][:])
{}
}
#else
template<typenameT,intI>
structSA{
staticintss;
#pragma omp threadprivate(ss) // expected-note {{defined as threadprivate or thread local}}
floata;
intb[12];
float*c;
Td;
floate[I];
T*f;
voidfunc(intarg){
#pragma omp target teams map(arg,a,d)
{}
#pragma omp target teams map(arg[2:2],a,d) // expected-error {{subscripted value is not an array or pointer}}
{}
#pragma omp target teams map(arg,a*2) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
{}
#pragma omp target teams map(arg,(c+1)[2]) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
{}
#pragma omp target teams map(arg,a[:2],d) // expected-error {{subscripted value is not an array or pointer}}
{}
#pragma omp target teams map(arg,a,d[:2]) // expected-error {{subscripted value is not an array or pointer}}
{}
#pragma omp target teams map(to:ss) // expected-error {{threadprivate variables are not allowed in 'map' clause}}
{}
#pragma omp target teams map(to:b,e)
{}
#pragma omp target teams map(to:b,e) map(to:b) // expected-error {{variable already marked as mapped in current construct}} expected-note {{used here}}
{}
#pragma omp target teams map(to:b[:2],e)
{}
#pragma omp target teams map(to:b,e[:])
{}
#pragma omp target teams map(b[-1:]) // expected-error {{array section must be a subset of the original array}}
{}
#pragma omp target teams map(b[:-1]) // expected-error {{section length is evaluated to a negative value -1}}
{}
#pragma omp target teams map(always, tofrom: c,f)
{}
#pragma omp target teams map(always, tofrom: c[1:2],f)
{}
#pragma omp target teams map(always, tofrom: c,f[1:2])
{}
#pragma omp target teams map(always, tofrom: c[:],f) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
{}
#pragma omp target teams map(always, tofrom: c,f[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
{}
return;
}
};
structSB{
unsignedA;
unsignedB;
floatArr[100];
float*Ptr;
float*foo(){
return&Arr[0];
}
};
structSC{
unsignedA:2;
unsignedB:3;
unsignedC;
unsignedD;
floatArr[100];
SBS;
SBArrS[100];
SB*PtrS;
SB*&RPtrS;
float*Ptr;
SC(SB*&_RPtrS):RPtrS(_RPtrS){}
};
unionSD{
unsignedA;
floatB;
};
voidSAclient(intarg){
SA<int,123>s;
s.func(arg);// expected-note {{in instantiation of member function}}
doublemarr[10][10][10];
doublemarr2[5][10][1];
doublemvla[5][arg][10];
double***mptr;
constintn=0;
constintm=1;
doublemvla2[5][arg][m+n+10];
SB*p;
SDu;
SCr(p),t(p);
#pragma omp target teams map(r)
{}
#pragma omp target teams map(marr[2][0:2][0:2]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr[:][0:2][0:2]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr[2][3][0:2])
{}
#pragma omp target teams map(marr[:][:][:])
{}
#pragma omp target teams map(marr[:2][:][:])
{}
#pragma omp target teams map(marr[arg:][:][:])
{}
#pragma omp target teams map(marr[arg:])
{}
#pragma omp target teams map(marr[arg:][:arg][:]) // correct if arg is the size of dimension 2
{}
#pragma omp target teams map(marr[:arg][:])
{}
#pragma omp target teams map(marr[:arg][n:])
{}
#pragma omp target teams map(marr[:][:arg][n:]) // correct if arg is the size of dimension 2
{}
#pragma omp target teams map(marr[:][:m][n:]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr[n:m][:arg][n:])
{}
#pragma omp target teams map(marr[:2][:1][:]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr[:2][1:][:]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr[:2][:][:1]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr[:2][:][1:]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr[:1][:2][:])
{}
#pragma omp target teams map(marr[:1][0][:])
{}
#pragma omp target teams map(marr[:arg][:2][:]) // correct if arg is 1
{}
#pragma omp target teams map(marr[:1][3:1][:2])
{}
#pragma omp target teams map(marr[:1][3:arg][:2]) // correct if arg is 1
{}
#pragma omp target teams map(marr[:1][3:2][:2]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr[:2][:10][:])
{}
#pragma omp target teams map(marr[:2][:][:5+5])
{}
#pragma omp target teams map(marr[:2][2+2-4:][0:5+5])
{}
#pragma omp target teams map(marr[:1][:2][0]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(marr2[:1][:2][0])
{}
#pragma omp target teams map(mvla[:1][:][0]) // correct if the size of dimension 2 is 1.
{}
#pragma omp target teams map(mvla[:2][:arg][:]) // correct if arg is the size of dimension 2.
{}
#pragma omp target teams map(mvla[:1][:2][0]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(mvla[1][2:arg][:])
{}
#pragma omp target teams map(mvla[:1][:][:])
{}
#pragma omp target teams map(mvla2[:1][:2][:11])
{}
#pragma omp target teams map(mvla2[:1][:2][:10]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(mptr[:2][2+2-4:1][0:5+5]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(mptr[:1][:2-1][2:4-3])
{}
#pragma omp target teams map(mptr[:1][:arg][2:4-3]) // correct if arg is 1.
{}
#pragma omp target teams map(mptr[:1][:2-1][0:2])
{}
#pragma omp target teams map(mptr[:1][:2][0:2]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(mptr[:1][:][0:2]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
{}
#pragma omp target teams map(mptr[:2][:1][0:2]) // expected-error {{array section does not specify contiguous storage}}
{}
#pragma omp target teams map(r.ArrS[0].B)
{}
#pragma omp target teams map(r.ArrS[:1].B) // expected-error {{OpenMP array section is not allowed here}}
{}
#pragma omp target teams map(r.ArrS[:arg].B) // expected-error {{OpenMP array section is not allowed here}}
{}
#pragma omp target teams map(r.ArrS[0].Arr[1:23])
{}
#pragma omp target teams map(r.ArrS[0].Arr[1:arg])
{}
#pragma omp target teams map(r.ArrS[0].Arr[arg:23])
{}
#pragma omp target teams map(r.ArrS[0].Error) // expected-error {{no member named 'Error' in 'SB'}}
{}
#pragma omp target teams map(r.ArrS[0].A, r.ArrS[1].A) // expected-error {{multiple array elements associated with the same variable are not allowed in map clauses of the same construct}} expected-note {{used here}}
{}
#pragma omp target teams map(r.ArrS[0].A, t.ArrS[1].A)
#pragma omp target teams map(r.PtrS, r.PtrS->B) // expected-error {{pointer cannot be mapped along with a section derived from itself}} expected-note {{used here}}
{}
#pragma omp target teams map(r.PtrS->A, r.PtrS->B)
{}
#pragma omp target teams map(r.RPtrS[0], r.RPtrS->B) // expected-error {{same pointer dereferenced in multiple different ways in map clause expressions}} expected-note {{used here}}
{}
#pragma omp target teams map(r.RPtrS, r.RPtrS->B) // expected-error {{pointer cannot be mapped along with a section derived from itself}} expected-note {{used here}}
{}
#pragma omp target teams map(r.RPtrS->A, r.RPtrS->B)
#pragma omp target teams map(r.S.foo()[:12]) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
{}
#pragma omp target teams map(r.C, r.D)
{}
#pragma omp target teams map(r.C, r.C) // expected-error {{variable already marked as mapped in current construct}} expected-note {{used here}}
{}
#pragma omp target teams map(r.C) map(r.C) // expected-error {{variable already marked as mapped in current construct}} expected-note {{used here}}
{}
#pragma omp target teams map(r.C, r.S) // this would be an error only caught at runtime - Sema would have to make sure there is not way for the missing data between fields to be mapped somewhere else.
{}
#pragma omp target teams map(r, r.S) // expected-error {{variable already marked as mapped in current construct}} expected-note {{used here}}
{}
#pragma omp target teams map(r.C, t.C)
{}
#pragma omp target teams map(r.A) // expected-error {{bit fields cannot be used to specify storage in a 'map' clause}}
{}
#pragma omp target teams map(r.Arr)
{}
#pragma omp target teams map(r.Arr[3:5])
{}
#pragma omp target teams map(r.Ptr[3:5])
{}
#pragma omp target teams map(r.ArrS[3:5].A) // expected-error {{OpenMP array section is not allowed here}}
{}
#pragma omp target teams map(r.ArrS[3:5].Arr[6:7]) // expected-error {{OpenMP array section is not allowed here}}
{}
#pragma omp target teams map(r.ArrS[3].Arr[6:7])
{}
#pragma omp target teams map(r.S.Arr[4:5])
{}
#pragma omp target teams map(r.S.Ptr[4:5])
{}
#pragma omp target teams map(r.S.Ptr[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
{}
#pragma omp target teams map((p+1)->A) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
#pragma omp target data map(to: r.C) //expected-note {{used here}}
{
#pragma omp target teams map(r.D) // expected-error {{original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage}}
{}
}
#pragma omp target data map(to: t.Ptr) //expected-note {{used here}}
{
#pragma omp target teams map(t.Ptr[:23]) // expected-error {{pointer cannot be mapped along with a section derived from itself}}
#pragma omp target teams map // expected-error {{expected '(' after 'map'}}
{}
#pragma omp target teams map( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
{}
#pragma omp target teams map() // expected-error {{expected expression}}
{}
#pragma omp target teams map(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
{}
#pragma omp target teams map(to argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected ',' or ')' in 'map' clause}}
{}
#pragma omp target teams map(to:) // expected-error {{expected expression}}
{}
#pragma omp target teams map(from: argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
{}
#pragma omp target teams map(x: y) // expected-error {{incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'}}
{}
#pragma omp target teams map(x)
foo();
#pragma omp target teams map(tofrom: t[:I])
foo();
#pragma omp target teams map(T: a) // expected-error {{incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'}} expected-error {{incomplete type 'S1' where a complete type is required}}
foo();
#pragma omp target teams map(T) // expected-error {{'T' does not refer to a value}}
foo();
#pragma omp target teams map(I) // expected-error 2 {{expected expression containing only member accesses and/or array sections based on named variables}}
foo();
#pragma omp target teams map(S2::S2s)
foo();
#pragma omp target teams map(S2::S2sc)
foo();
#pragma omp target teams map(x)
foo();
#pragma omp target teams map(to: x)
foo();
#pragma omp target teams map(to: to)
foo();
#pragma omp target teams map(to)
foo();
#pragma omp target teams map(to, x)
foo();
#pragma omp target data map(to x) // expected-error {{expected ',' or ')' in 'map' clause}}
#pragma omp target data map(tofrom: argc > 0 ? x : y) // expected-error 2 {{expected expression containing only member accesses and/or array sections based on named variables}}
#pragma omp target data map(argc)
#pragma omp target data map(S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp target data map(h) // expected-error {{threadprivate variables are not allowed in 'map' clause}}
#pragma omp target data map(k) map(k) // expected-error 2 {{variable already marked as mapped in current construct}} expected-note 2 {{used here}}
#pragma omp target teams map(k), map(k[:5]) // expected-error 2 {{pointer cannot be mapped along with a section derived from itself}} expected-note 2 {{used here}}
#pragma omp target data map // expected-error {{expected '(' after 'map'}} expected-error {{expected at least one 'map' or 'use_device_ptr' clause for '#pragma omp target data'}}
#pragma omp target data map( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
#pragma omp target data map() // expected-error {{expected expression}}
#pragma omp target data map(alloc) // expected-error {{use of undeclared identifier 'alloc'}}
#pragma omp target data map(to argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected ',' or ')' in 'map' clause}}
#pragma omp target data map(to:) // expected-error {{expected expression}}
#pragma omp target data map(from: argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target data map(x: y) // expected-error {{incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'}}
#pragma omp target teams map(x)
foo();
#pragma omp target teams map(to: x)
foo();
#pragma omp target teams map(to: to)
foo();
#pragma omp target teams map(to)
foo();
#pragma omp target teams map(to, x)
foo();
#pragma omp target data map(to x) // expected-error {{expected ',' or ')' in 'map' clause}}
#pragma omp target data map(tofrom: argc > 0 ? argv[1] : argv[2]) // expected-error {{xpected expression containing only member accesses and/or array sections based on named variables}}
#pragma omp target data map(argc)
#pragma omp target data map(S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp target data map(h) // expected-error {{threadprivate variables are not allowed in 'map' clause}}
#pragma omp target data map(k), map(k) // expected-error {{variable already marked as mapped in current construct}} expected-note {{used here}}
#pragma omp target teams map(k), map(k[:5]) // expected-error {{pointer cannot be mapped along with a section derived from itself}} expected-note {{used here}}
#pragma omp target data map(tofrom, always: x) // expected-error {{incorrect map type modifier, expected 'always'}} expected-error {{incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'}}
#pragma omp target data map(always, tofrom: always, tofrom, x)
#pragma omp target teams map(tofrom j) // expected-error {{expected ',' or ')' in 'map' clause}}
foo();
#pragma omp target teams private(j) map(j) // expected-error {{private variable cannot be in a map clause in '#pragma omp target teams' directive}} expected-note {{defined as private}}
{}
#pragma omp target teams firstprivate(j) map(j) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target teams' directive}} expected-note {{defined as firstprivate}}