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;
}
#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}}
#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}}