if (const auto *VD = dyn_cast<VarDecl>(D)) {
if (!VD->hasLocalStorage()) {
+ if (isInOpenMPTargetExecutionDirective())
+ return true;
DSAStackTy::DSAVarData TopDVar =
DSAStack->getTopDSA(D, /*FromParent=*/false);
unsigned NumLevels =
getOpenMPCaptureLevels(DSAStack->getDirective(Level));
if (Level == 0)
return (NumLevels == CaptureLevel + 1) && TopDVar.CKind != OMPC_shared;
- DSAStackTy::DSAVarData DVar = DSAStack->getImplicitDSA(D, Level - 1);
- return DVar.CKind != OMPC_shared ||
- isOpenMPGlobalCapturedDecl(
- D, Level - 1,
- getOpenMPCaptureLevels(DSAStack->getDirective(Level - 1)) - 1);
+ do {
+ --Level;
+ DSAStackTy::DSAVarData DVar = DSAStack->getImplicitDSA(D, Level);
+ if (DVar.CKind != OMPC_shared)
+ return true;
+ } while (Level >= 0);
}
}
return true;
// CHECK: [[IFEND]]
+// OMP45: define internal void @__omp_offloading_{{.+}}_{{.+}}bar{{.+}}_l838(i[[SZ]] %{{.+}})
+
// OMP45: define {{.*}}@{{.*}}zee{{.*}}
// OMP45: [[LOCAL_THIS:%.+]] = alloca [[S2]]*
// CHECK-DAG: load i16, i16* [[REF_AA]]
// CHECK-DAG: getelementptr inbounds [10 x i32], [10 x i32]* [[REF_B]], i[[SZ]] 0, i[[SZ]] 2
+// OMP50: define internal void @__omp_offloading_{{.+}}_{{.+}}bar{{.+}}_l838(i[[SZ]] %{{.+}})
// OMP50: define {{.*}}@{{.*}}zee{{.*}}
void bar () {
#define pragma_target _Pragma("omp target")
pragma_target
-{}
+{
+ global = 0;
+#pragma omp parallel shared(global)
+ global = 1;
+}
}
class S2 {