forked from OSchip/llvm-project
[OPENMP] issue error messages for multiple teams contructs in a target construct
The fix is to issue error messages if there are more than one teams construct inside a target constructs. #pragma omp target { #pragma omp teams { ... } #pragma omp teams { ... } } llvm-svn: 353186
This commit is contained in:
parent
a3ec627a1c
commit
620ba6035e
|
@ -7067,7 +7067,9 @@ StmtResult Sema::ActOnOpenMPTargetDirective(ArrayRef<OMPClause *> Clauses,
|
|||
auto I = CS->body_begin();
|
||||
while (I != CS->body_end()) {
|
||||
const auto *OED = dyn_cast<OMPExecutableDirective>(*I);
|
||||
if (!OED || !isOpenMPTeamsDirective(OED->getDirectiveKind())) {
|
||||
if (!OED || !isOpenMPTeamsDirective(OED->getDirectiveKind()) ||
|
||||
OMPTeamsFound) {
|
||||
|
||||
OMPTeamsFound = false;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -4078,6 +4078,13 @@ void foo() {
|
|||
#pragma omp teams
|
||||
++a;
|
||||
}
|
||||
#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}}
|
||||
{
|
||||
#pragma omp teams // expected-note {{directive outside teams construct here}}
|
||||
++a;
|
||||
#pragma omp teams // expected-note {{nested teams construct here}}
|
||||
++a;
|
||||
}
|
||||
#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}}
|
||||
{
|
||||
++a; // expected-note {{statement outside teams construct here}}
|
||||
|
@ -12691,6 +12698,13 @@ void foo() {
|
|||
#pragma omp teams
|
||||
++a;
|
||||
}
|
||||
#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}}
|
||||
{
|
||||
#pragma omp teams // expected-note {{directive outside teams construct here}}
|
||||
++a;
|
||||
#pragma omp teams // expected-note {{nested teams construct here}}
|
||||
++a;
|
||||
}
|
||||
#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}}
|
||||
{
|
||||
++a; // expected-note {{statement outside teams construct here}}
|
||||
|
|
Loading…
Reference in New Issue