Fix missing generate capture expression for novariants condition.

This commit is contained in:
Jennifer Yu 2021-04-07 09:26:14 -07:00
parent 7d8513b7f2
commit ebf2dc3328
2 changed files with 7 additions and 0 deletions

View File

@ -14905,6 +14905,7 @@ OMPClause *Sema::ActOnOpenMPNovariantsClause(Expr *Condition,
if (CaptureRegion != OMPD_unknown && !CurContext->isDependentContext()) {
ValExpr = MakeFullExpr(ValExpr).get();
llvm::MapVector<const Expr *, DeclRefExpr *> Captures;
ValExpr = tryBuildCapture(*this, ValExpr, Captures).get();
HelperValStmt = buildPreInits(Context, Captures);
}
}

View File

@ -56,6 +56,9 @@ void test_one()
//DUMP: OMPDependClause
//DUMP: OMPNowaitClause
//DUMP: OMPNovariantsClause
//DUMP: DeclRefExpr {{.*}} 'bool' lvalue OMPCapturedExpr
//DUMP: OMPNocontextClause
//DUMP: DeclRefExpr {{.*}} 'bool' lvalue OMPCapturedExpr
#pragma omp dispatch depend(in:var) nowait novariants(aaa > 5) nocontext(bbb > 5)
foo(aaa, &bbb);
@ -66,6 +69,9 @@ void test_one()
//DUMP: OMPDeviceClause
//DUMP: OMPIs_device_ptrClause
//DUMP: OMPNovariantsClause
//DUMP: DeclRefExpr {{.*}} 'bool' lvalue OMPCapturedExpr
//DUMP: OMPNocontextClause
//DUMP: DeclRefExpr {{.*}} 'bool' lvalue OMPCapturedExpr
#pragma omp dispatch device(dev) is_device_ptr(dp) novariants(dev > 10) nocontext(dev > 5)
foo(aaa, dp);