Index: clang/lib/Sema/SemaOpenMP.cpp =================================================================== --- clang/lib/Sema/SemaOpenMP.cpp +++ clang/lib/Sema/SemaOpenMP.cpp @@ -16314,6 +16314,16 @@ return true; } +static BinaryOperatorKind +getRelatedCompoundReductionOp(BinaryOperatorKind BOK) { + if (BOK == BO_Add) return BO_AddAssign; + if (BOK == BO_Mul) return BO_MulAssign; + if (BOK == BO_And) return BO_AndAssign; + if (BOK == BO_Or) return BO_OrAssign; + if (BOK == BO_Xor) return BO_XorAssign; + return BOK; +} + static bool actOnOMPReductionKindClause( Sema &S, DSAStackTy *Stack, OpenMPClauseKind ClauseKind, ArrayRef VarList, SourceLocation StartLoc, SourceLocation LParenLoc, @@ -16839,25 +16849,35 @@ CallExpr::Create(Context, OVE, Args, Context.VoidTy, VK_RValue, ELoc, S.CurFPFeatureOverrides()); } else { - ReductionOp = S.BuildBinOp( - Stack->getCurScope(), ReductionId.getBeginLoc(), BOK, LHSDRE, RHSDRE); - if (ReductionOp.isUsable()) { - if (BOK != BO_LT && BOK != BO_GT) { - ReductionOp = - S.BuildBinOp(Stack->getCurScope(), ReductionId.getBeginLoc(), - BO_Assign, LHSDRE, ReductionOp.get()); - } else { - auto *ConditionalOp = new (Context) - ConditionalOperator(ReductionOp.get(), ELoc, LHSDRE, ELoc, RHSDRE, - Type, VK_LValue, OK_Ordinary); - ReductionOp = - S.BuildBinOp(Stack->getCurScope(), ReductionId.getBeginLoc(), - BO_Assign, LHSDRE, ConditionalOp); + BinaryOperatorKind CombBOK = getRelatedCompoundReductionOp(BOK); + if (Type->isRecordType() && CombBOK != BOK) { + Sema::TentativeAnalysisScope Trap(S); + ReductionOp = + S.BuildBinOp(Stack->getCurScope(), ReductionId.getBeginLoc(), + CombBOK, LHSDRE, RHSDRE); + } + if (!ReductionOp.isUsable()) { + ReductionOp = + S.BuildBinOp(Stack->getCurScope(), ReductionId.getBeginLoc(), BOK, + LHSDRE, RHSDRE); + if (ReductionOp.isUsable()) { + if (BOK != BO_LT && BOK != BO_GT) { + ReductionOp = + S.BuildBinOp(Stack->getCurScope(), ReductionId.getBeginLoc(), + BO_Assign, LHSDRE, ReductionOp.get()); + } else { + auto *ConditionalOp = new (Context) + ConditionalOperator(ReductionOp.get(), ELoc, LHSDRE, ELoc, + RHSDRE, Type, VK_LValue, OK_Ordinary); + ReductionOp = + S.BuildBinOp(Stack->getCurScope(), ReductionId.getBeginLoc(), + BO_Assign, LHSDRE, ConditionalOp); + } } - if (ReductionOp.isUsable()) - ReductionOp = S.ActOnFinishFullExpr(ReductionOp.get(), - /*DiscardedValue*/ false); } + if (ReductionOp.isUsable()) + ReductionOp = S.ActOnFinishFullExpr(ReductionOp.get(), + /*DiscardedValue*/ false); if (!ReductionOp.isUsable()) continue; } Index: clang/test/OpenMP/distribute_parallel_for_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/distribute_parallel_for_reduction_messages.cpp +++ clang/test/OpenMP/distribute_parallel_for_reduction_messages.cpp @@ -404,7 +404,7 @@ foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}} +#pragma omp distribute parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target Index: clang/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp +++ clang/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp @@ -403,7 +403,7 @@ foo(); #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp distribute parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target Index: clang/test/OpenMP/distribute_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/distribute_simd_reduction_messages.cpp +++ clang/test/OpenMP/distribute_simd_reduction_messages.cpp @@ -409,7 +409,7 @@ foo(); #pragma omp target #pragma omp teams -#pragma omp distribute simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}} +#pragma omp distribute simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} expected-warning {{Type 'S4' is not trivially copyable and not guaranteed to be mapped correctly}} expected-warning {{Type 'S5' is not trivially copyable and not guaranteed to be mapped correctly}}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target Index: clang/test/OpenMP/for_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/for_reduction_messages.cpp +++ clang/test/OpenMP/for_reduction_messages.cpp @@ -354,7 +354,7 @@ for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel Index: clang/test/OpenMP/for_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/for_simd_reduction_messages.cpp +++ clang/test/OpenMP/for_simd_reduction_messages.cpp @@ -345,7 +345,7 @@ for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel Index: clang/test/OpenMP/master_taskloop_in_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/master_taskloop_in_reduction_messages.cpp +++ clang/test/OpenMP/master_taskloop_in_reduction_messages.cpp @@ -344,7 +344,7 @@ #pragma omp master taskloop in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp master taskloop in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp master taskloop in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp taskgroup task_reduction(+:k) Index: clang/test/OpenMP/master_taskloop_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/master_taskloop_reduction_messages.cpp +++ clang/test/OpenMP/master_taskloop_reduction_messages.cpp @@ -312,7 +312,7 @@ #pragma omp master taskloop reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp master taskloop reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp master taskloop reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp master taskloop reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/master_taskloop_simd_in_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/master_taskloop_simd_in_reduction_messages.cpp +++ clang/test/OpenMP/master_taskloop_simd_in_reduction_messages.cpp @@ -344,7 +344,7 @@ #pragma omp master taskloop simd in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp master taskloop simd in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp master taskloop simd in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp taskgroup task_reduction(+:k) Index: clang/test/OpenMP/master_taskloop_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/master_taskloop_simd_reduction_messages.cpp +++ clang/test/OpenMP/master_taskloop_simd_reduction_messages.cpp @@ -312,7 +312,7 @@ #pragma omp master taskloop simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp master taskloop simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp master taskloop simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp master taskloop simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/parallel_for_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_for_reduction_messages.cpp +++ clang/test/OpenMP/parallel_for_reduction_messages.cpp @@ -301,7 +301,7 @@ #pragma omp parallel for reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel for reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/parallel_for_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_for_simd_reduction_messages.cpp +++ clang/test/OpenMP/parallel_for_simd_reduction_messages.cpp @@ -293,7 +293,7 @@ #pragma omp parallel for simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel for simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/parallel_master_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_master_reduction_messages.cpp +++ clang/test/OpenMP/parallel_master_reduction_messages.cpp @@ -349,7 +349,7 @@ { foo(); } -#pragma omp parallel master reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp parallel master reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} { foo(); } Index: clang/test/OpenMP/parallel_master_taskloop_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_master_taskloop_reduction_messages.cpp +++ clang/test/OpenMP/parallel_master_taskloop_reduction_messages.cpp @@ -312,7 +312,7 @@ #pragma omp parallel master taskloop reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp parallel master taskloop reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp parallel master taskloop reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel master taskloop reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/parallel_master_taskloop_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_master_taskloop_simd_reduction_messages.cpp +++ clang/test/OpenMP/parallel_master_taskloop_simd_reduction_messages.cpp @@ -312,7 +312,7 @@ #pragma omp parallel master taskloop simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp parallel master taskloop simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp parallel master taskloop simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel master taskloop simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/parallel_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_reduction_messages.cpp +++ clang/test/OpenMP/parallel_reduction_messages.cpp @@ -245,7 +245,7 @@ foo(); #pragma omp parallel reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} foo(); -#pragma omp parallel reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp parallel reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} foo(); #pragma omp parallel reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} foo(); Index: clang/test/OpenMP/parallel_sections_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/parallel_sections_reduction_messages.cpp +++ clang/test/OpenMP/parallel_sections_reduction_messages.cpp @@ -349,7 +349,7 @@ { foo(); } -#pragma omp parallel sections reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp parallel sections reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} { foo(); } Index: clang/test/OpenMP/reduction_compound_op.cpp =================================================================== --- /dev/null +++ clang/test/OpenMP/reduction_compound_op.cpp @@ -0,0 +1,108 @@ +//RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fopenmp -DNORM \ +//RUN: -emit-llvm -o - %s | FileCheck %s --check-prefixes=ALL,NORM + +//RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fopenmp -DCOMP \ +//RUN: -emit-llvm -o - %s | FileCheck %s --check-prefixes=ALL,COMP + +// Prefer compound operators since that is what the spec seems to say. +//RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fopenmp -DNORM -DCOMP \ +//RUN: -emit-llvm -o - %s | FileCheck %s --check-prefixes=ALL,COMP + +struct Point { + int x = 0; + int y = 0; +#if NORM + Point operator+(Point const &other) const; + Point operator-(Point const &other) const; + Point operator*(Point const &other) const; + Point operator&(Point const &other) const; + Point operator|(Point const &other) const; + Point operator^(Point const &other) const; +#endif + Point operator&&(Point const &other) const; + Point operator||(Point const &other) const; + Point &operator=(Point const &other); +#if COMP + Point &operator+=(Point const &other); + Point &operator*=(Point const &other); + Point &operator&=(Point const &other); + Point &operator|=(Point const &other); + Point &operator^=(Point const &other); +#endif +}; + +void work(Point &P, int N, Point const *Points); + +//ALL-LABEL: foo +void foo(int N, Point const *Points) { + Point Red; + //ALL: define internal{{.*}}omp.reduction.reduction_func + //NORM: call{{.*}}_ZNK5PointplERKS_ + //NORM: call{{.*}}_ZN5PointaSERKS_ + //COMP: call{{.*}}_ZN5PointpLERKS_ + //ALL: ret void + #pragma omp parallel for reduction(+: Red) + for (unsigned I = 0; I < N; ++I) + work(Red, I, Points); + + //ALL: define internal{{.*}}omp.reduction.reduction_func + //NORM: call{{.*}}_ZNK5PointplERKS_ + //NORM: call{{.*}}_ZN5PointaSERKS_ + //COMP: call{{.*}}_ZN5PointpLERKS_ + //ALL: ret void + #pragma omp parallel for reduction(-: Red) + for (unsigned I = 0; I < N; ++I) + work(Red, I, Points); + + //ALL: define internal{{.*}}omp.reduction.reduction_func + //NORM: call{{.*}}_ZNK5PointmlERKS_ + //NORM: call{{.*}}_ZN5PointaSERKS_ + //COMP: call{{.*}}_ZN5PointmLERKS_ + //ALL: ret void + #pragma omp parallel for reduction(*: Red) + for (unsigned I = 0; I < N; ++I) + work(Red, I, Points); + + //ALL: define internal{{.*}}omp.reduction.reduction_func + //NORM: call{{.*}}_ZNK5PointanERKS_ + //NORM: call{{.*}}_ZN5PointaSERKS_ + //COMP: call{{.*}}_ZN5PointaNERKS_ + //ALL: ret void + #pragma omp parallel for reduction(&: Red) + for (unsigned I = 0; I < N; ++I) + work(Red, I, Points); + + //ALL: define internal{{.*}}omp.reduction.reduction_func + //NORM: call{{.*}}_ZNK5PointorERKS_ + //NORM: call{{.*}}_ZN5PointaSERKS_ + //COMP: call{{.*}}_ZN5PointoRERKS_ + //ALL: ret void + #pragma omp parallel for reduction(|: Red) + for (unsigned I = 0; I < N; ++I) + work(Red, I, Points); + + //ALL: define internal{{.*}}omp.reduction.reduction_func + //NORM: call{{.*}}_ZNK5PointeoERKS_ + //NORM: call{{.*}}_ZN5PointaSERKS_ + //COMP: call{{.*}}_ZN5PointeOERKS_ + //ALL: ret void + #pragma omp parallel for reduction(^: Red) + for (unsigned I = 0; I < N; ++I) + work(Red, I, Points); + + //ALL: define internal{{.*}}omp.reduction.reduction_func + //ALL: call{{.*}}_ZNK5PointaaERKS_ + //ALL: call{{.*}}_ZN5PointaSERKS_ + //ALL: ret void + #pragma omp parallel for reduction(&&: Red) + for (unsigned I = 0; I < N; ++I) + work(Red, I, Points); + + //ALL: define internal{{.*}}omp.reduction.reduction_func + //ALL: call{{.*}}_ZNK5PointooERKS_ + //ALL: call{{.*}}_ZN5PointaSERKS_ + //ALL: ret void + #pragma omp parallel for reduction(||: Red) + for (unsigned I = 0; I < N; ++I) + work(Red, I, Points); +} Index: clang/test/OpenMP/sections_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/sections_reduction_messages.cpp +++ clang/test/OpenMP/sections_reduction_messages.cpp @@ -401,7 +401,7 @@ foo(); } #pragma omp parallel -#pragma omp sections reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp sections reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} { foo(); } Index: clang/test/OpenMP/simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/simd_reduction_messages.cpp +++ clang/test/OpenMP/simd_reduction_messages.cpp @@ -296,7 +296,7 @@ #pragma omp simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/target_parallel_for_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/target_parallel_for_reduction_messages.cpp +++ clang/test/OpenMP/target_parallel_for_reduction_messages.cpp @@ -303,7 +303,7 @@ #pragma omp target parallel for reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp target parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp target parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target parallel for reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp +++ clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp @@ -305,7 +305,7 @@ #pragma omp target parallel for simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp target parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp target parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target parallel for simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/target_parallel_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/target_parallel_reduction_messages.cpp +++ clang/test/OpenMP/target_parallel_reduction_messages.cpp @@ -256,7 +256,7 @@ foo(); #pragma omp target parallel reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} foo(); -#pragma omp target parallel reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp target parallel reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} foo(); #pragma omp target parallel reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} foo(); Index: clang/test/OpenMP/target_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/target_reduction_messages.cpp +++ clang/test/OpenMP/target_reduction_messages.cpp @@ -253,7 +253,7 @@ foo(); #pragma omp target reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} foo(); -#pragma omp target reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp target reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} foo(); #pragma omp target reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} foo(); Index: clang/test/OpenMP/target_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/target_simd_reduction_messages.cpp +++ clang/test/OpenMP/target_simd_reduction_messages.cpp @@ -303,7 +303,7 @@ #pragma omp target simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp target simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp target simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp target simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp +++ clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp @@ -240,7 +240,7 @@ for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute parallel for reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int j=0; j<100; j++) foo(); -#pragma omp target teams distribute parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp target teams distribute parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute parallel for reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} for (int j=0; j<100; j++) foo(); Index: clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp +++ clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp @@ -241,7 +241,7 @@ for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute parallel for simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int j=0; j<100; j++) foo(); -#pragma omp target teams distribute parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp target teams distribute parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute parallel for simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} for (int j=0; j<100; j++) foo(); Index: clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp +++ clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp @@ -245,7 +245,7 @@ for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int j=0; j<100; j++) foo(); -#pragma omp target teams distribute reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp target teams distribute reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} for (int j=0; j<100; j++) foo(); Index: clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp +++ clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp @@ -241,7 +241,7 @@ for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int j=0; j<100; j++) foo(); -#pragma omp target teams distribute simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp target teams distribute simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int j=0; j<100; j++) foo(); #pragma omp target teams distribute simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} for (int j=0; j<100; j++) foo(); Index: clang/test/OpenMP/target_teams_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/target_teams_reduction_messages.cpp +++ clang/test/OpenMP/target_teams_reduction_messages.cpp @@ -256,7 +256,7 @@ foo(); #pragma omp target teams reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} foo(); -#pragma omp target teams reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp target teams reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} foo(); #pragma omp target teams reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} foo(); Index: clang/test/OpenMP/task_in_reduction_message.cpp =================================================================== --- clang/test/OpenMP/task_in_reduction_message.cpp +++ clang/test/OpenMP/task_in_reduction_message.cpp @@ -287,7 +287,7 @@ foo(); #pragma omp task in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}} foo(); -#pragma omp task in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp task in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} foo(); #pragma omp taskgroup task_reduction(+:k) #pragma omp task in_reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/taskgroup_task_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/taskgroup_task_reduction_messages.cpp +++ clang/test/OpenMP/taskgroup_task_reduction_messages.cpp @@ -228,7 +228,7 @@ foo(); #pragma omp taskgroup task_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be task_reduction}} foo(); -#pragma omp taskgroup task_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp taskgroup task_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} foo(); #pragma omp taskgroup task_reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} foo(); Index: clang/test/OpenMP/taskloop_in_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/taskloop_in_reduction_messages.cpp +++ clang/test/OpenMP/taskloop_in_reduction_messages.cpp @@ -344,7 +344,7 @@ #pragma omp taskloop in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp taskloop in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp taskloop in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp taskgroup task_reduction(+:k) Index: clang/test/OpenMP/taskloop_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/taskloop_reduction_messages.cpp +++ clang/test/OpenMP/taskloop_reduction_messages.cpp @@ -312,7 +312,7 @@ #pragma omp taskloop reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp taskloop reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp taskloop reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp taskloop reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/taskloop_simd_in_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/taskloop_simd_in_reduction_messages.cpp +++ clang/test/OpenMP/taskloop_simd_in_reduction_messages.cpp @@ -344,7 +344,7 @@ #pragma omp taskloop simd in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp taskloop simd in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp taskloop simd in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp taskgroup task_reduction(+:k) Index: clang/test/OpenMP/taskloop_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/taskloop_simd_reduction_messages.cpp +++ clang/test/OpenMP/taskloop_simd_reduction_messages.cpp @@ -312,7 +312,7 @@ #pragma omp taskloop simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); -#pragma omp taskloop simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp taskloop simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int i = 0; i < 10; ++i) foo(); #pragma omp taskloop simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp +++ clang/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp @@ -284,7 +284,7 @@ #pragma omp teams distribute parallel for reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int j=0; j<100; j++) foo(); #pragma omp target -#pragma omp teams distribute parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp teams distribute parallel for reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int j=0; j<100; j++) foo(); #pragma omp target #pragma omp teams distribute parallel for reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp +++ clang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp @@ -284,7 +284,7 @@ #pragma omp teams distribute parallel for simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int j=0; j<100; j++) foo(); #pragma omp target -#pragma omp teams distribute parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp teams distribute parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int j=0; j<100; j++) foo(); #pragma omp target #pragma omp teams distribute parallel for simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/teams_distribute_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/teams_distribute_reduction_messages.cpp +++ clang/test/OpenMP/teams_distribute_reduction_messages.cpp @@ -290,7 +290,7 @@ #pragma omp teams distribute reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int j=0; j<100; j++) foo(); #pragma omp target -#pragma omp teams distribute reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp teams distribute reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int j=0; j<100; j++) foo(); #pragma omp target #pragma omp teams distribute reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/teams_distribute_simd_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/teams_distribute_simd_reduction_messages.cpp +++ clang/test/OpenMP/teams_distribute_simd_reduction_messages.cpp @@ -284,7 +284,7 @@ #pragma omp teams distribute simd reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} for (int j=0; j<100; j++) foo(); #pragma omp target -#pragma omp teams distribute simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp teams distribute simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} for (int j=0; j<100; j++) foo(); #pragma omp target #pragma omp teams distribute simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}} Index: clang/test/OpenMP/teams_reduction_messages.cpp =================================================================== --- clang/test/OpenMP/teams_reduction_messages.cpp +++ clang/test/OpenMP/teams_reduction_messages.cpp @@ -303,7 +303,7 @@ #pragma omp teams reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} foo(); #pragma omp target -#pragma omp teams reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} +#pragma omp teams reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}} foo(); #pragma omp target #pragma omp teams reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}