diff options
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 7 | ||||
-rw-r--r-- | clang/test/OpenMP/parallel_reduction_codegen.cpp | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 798a2ef0c5d..0f2e328effc 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -3349,12 +3349,7 @@ static Address emitOMPArraySectionBase(CodeGenFunction &CGF, const Expr *Base, LValue CodeGenFunction::EmitOMPArraySectionExpr(const OMPArraySectionExpr *E, bool IsLowerBound) { - QualType BaseTy; - if (auto *ASE = - dyn_cast<OMPArraySectionExpr>(E->getBase()->IgnoreParenImpCasts())) - BaseTy = OMPArraySectionExpr::getBaseOriginalType(ASE); - else - BaseTy = E->getBase()->getType(); + QualType BaseTy = OMPArraySectionExpr::getBaseOriginalType(E->getBase()); QualType ResultExprTy; if (auto *AT = getContext().getAsArrayType(BaseTy)) ResultExprTy = AT->getElementType(); diff --git a/clang/test/OpenMP/parallel_reduction_codegen.cpp b/clang/test/OpenMP/parallel_reduction_codegen.cpp index e42776c740b..c4c0ff473a5 100644 --- a/clang/test/OpenMP/parallel_reduction_codegen.cpp +++ b/clang/test/OpenMP/parallel_reduction_codegen.cpp @@ -80,6 +80,14 @@ struct SST { // CHECK-DAG: [[REDUCTION_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 18, i32 0, i32 0, i8* // CHECK-DAG: [[REDUCTION_LOCK:@.+]] = common global [8 x i32] zeroinitializer +//CHECK: foo_array_sect +//CHECK: call void {{.+}}@__kmpc_fork_call( +//CHECK: ret void +void foo_array_sect(short x[1]) { +#pragma omp parallel reduction(+ : x[:]) + {} +} + template <typename T> T tmain() { T t; |