Author: abataev Date: Fri Dec 1 09:40:15 2017 New Revision: 319560 URL: http://llvm.org/viewvc/llvm-project?rev=319560&view=rev Log: [OPENMP] Do not allow variables to be first|last-privates in distribute directives.
OpenMP standard does not allow to mark the variables as firstprivate and lastprivate at the same time in distribute-based directives. Patch fixes this problem. Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp cfe/trunk/test/OpenMP/distribute_parallel_for_ast_print.cpp cfe/trunk/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp cfe/trunk/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp cfe/trunk/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp cfe/trunk/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp cfe/trunk/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp cfe/trunk/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp cfe/trunk/test/OpenMP/distribute_parallel_for_simd_misc_messages.c cfe/trunk/test/OpenMP/distribute_simd_ast_print.cpp cfe/trunk/test/OpenMP/distribute_simd_firstprivate_messages.cpp cfe/trunk/test/OpenMP/distribute_simd_lastprivate_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_loop_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_misc_messages.c cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c cfe/trunk/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp cfe/trunk/test/OpenMP/target_teams_distribute_simd_misc_messages.c cfe/trunk/test/OpenMP/teams_distribute_firstprivate_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_lastprivate_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_loop_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_simd_loop_messages.cpp Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original) +++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Fri Dec 1 09:40:15 2017 @@ -9146,7 +9146,8 @@ OMPClause *Sema::ActOnOpenMPFirstprivate // A list item may appear in a firstprivate or lastprivate clause but not // both. if (DVar.CKind != OMPC_unknown && DVar.CKind != OMPC_firstprivate && - (CurrDir == OMPD_distribute || DVar.CKind != OMPC_lastprivate) && + (isOpenMPDistributeDirective(CurrDir) || + DVar.CKind != OMPC_lastprivate) && DVar.RefExpr) { Diag(ELoc, diag::err_omp_wrong_dsa) << getOpenMPClauseName(DVar.CKind) @@ -9240,14 +9241,7 @@ OMPClause *Sema::ActOnOpenMPFirstprivate // OpenMP 4.5 [2.15.5.1, Restrictions, p.3] // A list item cannot appear in both a map clause and a data-sharing // attribute clause on the same construct - if (CurrDir == OMPD_target || CurrDir == OMPD_target_parallel || - CurrDir == OMPD_target_teams || - CurrDir == OMPD_target_teams_distribute || - CurrDir == OMPD_target_teams_distribute_parallel_for || - CurrDir == OMPD_target_teams_distribute_parallel_for_simd || - CurrDir == OMPD_target_teams_distribute_simd || - CurrDir == OMPD_target_parallel_for_simd || - CurrDir == OMPD_target_parallel_for) { + if (isOpenMPTargetExecutionDirective(CurrDir)) { OpenMPClauseKind ConflictKind; if (DSAStack->checkMappableExprComponentListsForDecl( VD, /*CurrentRegionOnly=*/true, @@ -9407,7 +9401,8 @@ OMPClause *Sema::ActOnOpenMPLastprivateC // both. DSAStackTy::DSAVarData DVar = DSAStack->getTopDSA(D, false); if (DVar.CKind != OMPC_unknown && DVar.CKind != OMPC_lastprivate && - (CurrDir == OMPD_distribute || DVar.CKind != OMPC_firstprivate) && + (isOpenMPDistributeDirective(CurrDir) || + DVar.CKind != OMPC_firstprivate) && (DVar.CKind != OMPC_private || DVar.RefExpr != nullptr)) { Diag(ELoc, diag::err_omp_wrong_dsa) << getOpenMPClauseName(DVar.CKind) Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_ast_print.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_ast_print.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_parallel_for_ast_print.cpp (original) +++ cfe/trunk/test/OpenMP/distribute_parallel_for_ast_print.cpp Fri Dec 1 09:40:15 2017 @@ -82,7 +82,7 @@ T tmain(T argc) { // CHECK-NEXT: a = 2; #pragma omp target #pragma omp teams -#pragma omp distribute parallel for private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N) +#pragma omp distribute parallel for private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) @@ -93,8 +93,8 @@ T tmain(T argc) { for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) - a++; - // CHECK: #pragma omp distribute parallel for private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N) + a++; + // CHECK: #pragma omp distribute parallel for private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -42,7 +42,7 @@ public: }; class S5 { int a; - S5(const S5 &s5) : a(s5.a) {} // expected-note 4 {{implicitly declared private here}} + S5(const S5 &s5) : a(s5.a) {} // expected-note 2 {{implicitly declared private here}} public: S5() : a(0) {} @@ -50,7 +50,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -150,9 +150,10 @@ int foomain(int argc, char **argv) { #pragma omp distribute parallel for firstprivate(i) for (int k = 0; k < argc; ++k) ++k; +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}} +#pragma omp distribute parallel for lastprivate(g) firstprivate(g) for (i = 0; i < argc; ++i) foo(); #pragma omp parallel private(i) @@ -314,14 +315,16 @@ int main(int argc, char **argv) { #pragma omp distribute parallel for firstprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}} +#pragma omp distribute parallel for lastprivate(g) firstprivate(g) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for lastprivate(n) firstprivate(n) // OK +#pragma omp distribute parallel for lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); #pragma omp parallel Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -313,14 +313,16 @@ int main(int argc, char **argv) { #pragma omp distribute parallel for lastprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{firstprivate variable cannot be lastprivate}} expected-note@+3 {{defined as firstprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +#pragma omp distribute parallel for firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for lastprivate(n) firstprivate(n) // OK +#pragma omp distribute parallel for lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp (original) +++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp Fri Dec 1 09:40:15 2017 @@ -83,7 +83,7 @@ T tmain(T argc) { // CHECK-NEXT: a = 2; #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N) +#pragma omp distribute parallel for simd private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) schedule(static, N) if (parallel :argc) num_threads(N) default(shared) shared(e) reduction(+ : h) dist_schedule(static,N) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) @@ -94,8 +94,8 @@ T tmain(T argc) { for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j) - a++; - // CHECK: #pragma omp distribute parallel for simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N) + a++; + // CHECK: #pragma omp distribute parallel for simd private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) schedule(static, N) if(parallel: argc) num_threads(N) default(shared) shared(e) reduction(+: h) dist_schedule(static, N) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int j = 0; j < 2; ++j) Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -42,7 +42,7 @@ public: }; class S5 { int a; - S5(const S5 &s5) : a(s5.a) {} // expected-note 4 {{implicitly declared private here}} + S5(const S5 &s5) : a(s5.a) {} // expected-note 2 {{implicitly declared private here}} public: S5() : a(0) {} @@ -50,7 +50,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -150,9 +150,10 @@ int foomain(int argc, char **argv) { #pragma omp distribute parallel for simd firstprivate(i) for (int k = 0; k < argc; ++k) ++k; +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}} +#pragma omp distribute parallel for simd lastprivate(g) firstprivate(g) for (i = 0; i < argc; ++i) foo(); #pragma omp parallel private(i) @@ -314,14 +315,16 @@ int main(int argc, char **argv) { #pragma omp distribute parallel for simd firstprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}} +#pragma omp distribute parallel for simd lastprivate(g) firstprivate(g) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd lastprivate(n) firstprivate(n) // OK +#pragma omp distribute parallel for simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); #pragma omp parallel Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -313,14 +313,16 @@ int main(int argc, char **argv) { #pragma omp distribute parallel for simd lastprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{firstprivate variable cannot be lastprivate}} expected-note@+3 {{defined as firstprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +#pragma omp distribute parallel for simd firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd lastprivate(n) firstprivate(n) // OK +#pragma omp distribute parallel for simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp (original) +++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp Fri Dec 1 09:40:15 2017 @@ -2,7 +2,7 @@ class S { int a; - S() : a(0) {} + S() : a(0) {} // expected-note {{implicitly declared private here}} public: S(int v) : a(v) {} @@ -790,9 +790,10 @@ void test_loop_eh() { void test_loop_firstprivate_lastprivate() { S s(4); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd lastprivate(s) firstprivate(s) +#pragma omp distribute parallel for simd lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} for (int i = 0; i < 16; ++i) ; } Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_misc_messages.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_misc_messages.c?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_misc_messages.c (original) +++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_misc_messages.c Fri Dec 1 09:40:15 2017 @@ -851,16 +851,19 @@ void test_firstprivate() { ; int x, y, z; +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams #pragma omp distribute parallel for simd lastprivate(x) firstprivate(x) for (i = 0; i < 16; ++i) ; +// expected-error@+3 2 {{lastprivate variable cannot be firstprivate}} expected-note@+3 2 {{defined as lastprivate}} #pragma omp target #pragma omp teams #pragma omp distribute parallel for simd lastprivate(x, y) firstprivate(x, y) for (i = 0; i < 16; ++i) ; +// expected-error@+3 3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 3 {{defined as lastprivate}} #pragma omp target #pragma omp teams #pragma omp distribute parallel for simd lastprivate(x, y, z) firstprivate(x, y, z) Modified: cfe/trunk/test/OpenMP/distribute_simd_ast_print.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_ast_print.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_simd_ast_print.cpp (original) +++ cfe/trunk/test/OpenMP/distribute_simd_ast_print.cpp Fri Dec 1 09:40:15 2017 @@ -84,14 +84,14 @@ T tmain(T argc) { #pragma omp target #pragma omp teams -#pragma omp distribute simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) reduction(+ : h) dist_schedule(static,N) +#pragma omp distribute simd private(argc, b), firstprivate(c, d), lastprivate(f) collapse(N) reduction(+ : h) dist_schedule(static,N) for (int i = 0; i < 2; ++i) for (int j = 0; j < 2; ++j) for (int k = 0; k < 10; ++k) for (int m = 0; m < 10; ++m) for (int n = 0; n < 10; ++n) a++; -// CHECK: #pragma omp distribute simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) reduction(+: h) dist_schedule(static, N) +// CHECK: #pragma omp distribute simd private(argc,b) firstprivate(c,d) lastprivate(f) collapse(N) reduction(+: h) dist_schedule(static, N) // CHECK-NEXT: for (int i = 0; i < 2; ++i) // CHECK-NEXT: for (int j = 0; j < 2; ++j) // CHECK-NEXT: for (int k = 0; k < 10; ++k) Modified: cfe/trunk/test/OpenMP/distribute_simd_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_simd_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/distribute_simd_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -42,7 +42,7 @@ public: }; class S5 { int a; - S5(const S5 &s5) : a(s5.a) {} // expected-note 4 {{implicitly declared private here}} + S5(const S5 &s5) : a(s5.a) {} // expected-note 2 {{implicitly declared private here}} public: S5() : a(0) {} @@ -50,7 +50,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -150,9 +150,10 @@ int foomain(int argc, char **argv) { #pragma omp distribute simd firstprivate(i) for (int k = 0; k < argc; ++k) ++k; +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute simd lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}} +#pragma omp distribute simd lastprivate(g) firstprivate(g) for (i = 0; i < argc; ++i) foo(); #pragma omp parallel private(i) @@ -314,14 +315,16 @@ int main(int argc, char **argv) { #pragma omp distribute simd firstprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute simd lastprivate(g) firstprivate(g) // expected-error {{calling a private constructor of class 'S5'}} +#pragma omp distribute simd lastprivate(g) firstprivate(g) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute simd lastprivate(n) firstprivate(n) // OK +#pragma omp distribute simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); #pragma omp parallel Modified: cfe/trunk/test/OpenMP/distribute_simd_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/distribute_simd_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/distribute_simd_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -313,14 +313,16 @@ int main(int argc, char **argv) { #pragma omp distribute simd lastprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{firstprivate variable cannot be lastprivate}} expected-note@+3 {{defined as firstprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute simd firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +#pragma omp distribute simd firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute simd lastprivate(n) firstprivate(n) // OK +#pragma omp distribute simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -125,7 +125,8 @@ int main(int argc, char **argv) { #pragma omp target teams distribute firstprivate(j) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute lastprivate(argc), firstprivate(argc) // OK +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute lastprivate(argc), firstprivate(argc) for (i = 0; i < argc; ++i) foo(); return 0; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -215,10 +215,12 @@ int main(int argc, char **argv) { #pragma omp target teams distribute lastprivate(j) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +// expected-error@+1 {{firstprivate variable cannot be lastprivate}} expected-note@+1 {{defined as firstprivate}} +#pragma omp target teams distribute firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute lastprivate(n) firstprivate(n) // OK +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_loop_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_loop_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_loop_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_loop_messages.cpp Fri Dec 1 09:40:15 2017 @@ -2,7 +2,7 @@ class S { int a; - S() : a(0) {} + S() : a(0) {} // expected-note {{implicitly declared private here}} public: S(int v) : a(v) {} @@ -607,7 +607,8 @@ void test_loop_eh() { void test_loop_firstprivate_lastprivate() { S s(4); -#pragma omp target teams distribute lastprivate(s) firstprivate(s) +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} for (int i = 0; i < 16; ++i) ; } Modified: cfe/trunk/test/OpenMP/target_teams_distribute_misc_messages.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_misc_messages.c?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_misc_messages.c (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_misc_messages.c Fri Dec 1 09:40:15 2017 @@ -285,12 +285,15 @@ void test_firstprivate() { ; int x, y, z; +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} #pragma omp target teams distribute lastprivate(x) firstprivate(x) for (i = 0; i < 16; ++i) ; +// expected-error@+1 2 {{lastprivate variable cannot be firstprivate}} expected-note@+1 2 {{defined as lastprivate}} #pragma omp target teams distribute lastprivate(x, y) firstprivate(x, y) for (i = 0; i < 16; ++i) ; +// expected-error@+1 3 {{lastprivate variable cannot be firstprivate}} expected-note@+1 3 {{defined as lastprivate}} #pragma omp target teams distribute lastprivate(x, y, z) firstprivate(x, y, z) for (i = 0; i < 16; ++i) ; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -124,7 +124,8 @@ int main(int argc, char **argv) { #pragma omp target teams distribute parallel for firstprivate(j) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for lastprivate(argc), firstprivate(argc) // OK +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute parallel for lastprivate(argc), firstprivate(argc) for (i = 0; i < argc; ++i) foo(); return 0; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -216,10 +216,12 @@ int main(int argc, char **argv) { #pragma omp target teams distribute parallel for lastprivate(j) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +// expected-error@+1 {{firstprivate variable cannot be lastprivate}} expected-note@+1 {{defined as firstprivate}} +#pragma omp target teams distribute parallel for firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for lastprivate(n) firstprivate(n) // OK +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute parallel for lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp Fri Dec 1 09:40:15 2017 @@ -2,7 +2,7 @@ class S { int a; - S() : a(0) {} + S() : a(0) {} // expected-note {{implicitly declared private here}} public: S(int v) : a(v) {} @@ -605,7 +605,8 @@ void test_loop_eh() { void test_loop_firstprivate_lastprivate() { S s(4); -#pragma omp target teams distribute parallel for lastprivate(s) firstprivate(s) +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute parallel for lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} for (int i = 0; i < 16; ++i) ; } Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c Fri Dec 1 09:40:15 2017 @@ -285,12 +285,15 @@ void test_firstprivate() { ; int x, y, z; +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} #pragma omp target teams distribute parallel for lastprivate(x) firstprivate(x) for (i = 0; i < 16; ++i) ; +// expected-error@+1 2 {{lastprivate variable cannot be firstprivate}} expected-note@+1 2 {{defined as lastprivate}} #pragma omp target teams distribute parallel for lastprivate(x, y) firstprivate(x, y) for (i = 0; i < 16; ++i) ; +// expected-error@+1 3 {{lastprivate variable cannot be firstprivate}} expected-note@+1 3 {{defined as lastprivate}} #pragma omp target teams distribute parallel for lastprivate(x, y, z) firstprivate(x, y, z) for (i = 0; i < 16; ++i) ; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -124,7 +124,8 @@ int main(int argc, char **argv) { #pragma omp target teams distribute parallel for simd firstprivate(j) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd lastprivate(argc), firstprivate(argc) // OK +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute parallel for simd lastprivate(argc), firstprivate(argc) for (i = 0; i < argc; ++i) foo(); return 0; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -216,10 +216,12 @@ int main(int argc, char **argv) { #pragma omp target teams distribute parallel for simd lastprivate(j) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +// expected-error@+1 {{firstprivate variable cannot be lastprivate}} expected-note@+1 {{defined as firstprivate}} +#pragma omp target teams distribute parallel for simd firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute parallel for simd lastprivate(n) firstprivate(n) // OK +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute parallel for simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp Fri Dec 1 09:40:15 2017 @@ -2,7 +2,7 @@ class S { int a; - S() : a(0) {} + S() : a(0) {} // expected-note {{implicitly declared private here}} public: S(int v) : a(v) {} @@ -608,7 +608,8 @@ void test_loop_eh() { void test_loop_firstprivate_lastprivate() { S s(4); -#pragma omp target teams distribute parallel for simd lastprivate(s) firstprivate(s) +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute parallel for simd lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} for (int i = 0; i < 16; ++i) ; } Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c Fri Dec 1 09:40:15 2017 @@ -285,12 +285,15 @@ void test_firstprivate() { ; int x, y, z; +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} #pragma omp target teams distribute parallel for simd lastprivate(x) firstprivate(x) for (i = 0; i < 16; ++i) ; +// expected-error@+1 2 {{lastprivate variable cannot be firstprivate}} expected-note@+1 2 {{defined as lastprivate}} #pragma omp target teams distribute parallel for simd lastprivate(x, y) firstprivate(x, y) for (i = 0; i < 16; ++i) ; +// expected-error@+1 3 {{lastprivate variable cannot be firstprivate}} expected-note@+1 3 {{defined as lastprivate}} #pragma omp target teams distribute parallel for simd lastprivate(x, y, z) firstprivate(x, y, z) for (i = 0; i < 16; ++i) ; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -124,7 +124,8 @@ int main(int argc, char **argv) { #pragma omp target teams distribute simd firstprivate(j) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd lastprivate(argc), firstprivate(argc) // OK +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute simd lastprivate(argc), firstprivate(argc) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd firstprivate(argc) map(argc) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target teams distribute simd' directive}} expected-note {{defined as firstprivate}} Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -216,10 +216,12 @@ int main(int argc, char **argv) { #pragma omp target teams distribute simd lastprivate(j) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +// expected-error@+1 {{firstprivate variable cannot be lastprivate}} expected-note@+1 {{defined as firstprivate}} +#pragma omp target teams distribute simd firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); -#pragma omp target teams distribute simd lastprivate(n) firstprivate(n) // OK +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp Fri Dec 1 09:40:15 2017 @@ -2,7 +2,7 @@ class S { int a; - S() : a(0) {} + S() : a(0) {} // expected-note {{implicitly declared private here}} public: S(int v) : a(v) {} @@ -607,7 +607,8 @@ void test_loop_eh() { void test_loop_firstprivate_lastprivate() { S s(4); -#pragma omp target teams distribute simd lastprivate(s) firstprivate(s) +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} +#pragma omp target teams distribute simd lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} for (int i = 0; i < 16; ++i) ; } Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_misc_messages.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_misc_messages.c?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/target_teams_distribute_simd_misc_messages.c (original) +++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_misc_messages.c Fri Dec 1 09:40:15 2017 @@ -285,12 +285,15 @@ void test_firstprivate() { ; int x, y, z; +// expected-error@+1 {{lastprivate variable cannot be firstprivate}} expected-note@+1 {{defined as lastprivate}} #pragma omp target teams distribute simd lastprivate(x) firstprivate(x) for (i = 0; i < 16; ++i) ; +// expected-error@+1 2 {{lastprivate variable cannot be firstprivate}} expected-note@+1 2 {{defined as lastprivate}} #pragma omp target teams distribute simd lastprivate(x, y) firstprivate(x, y) for (i = 0; i < 16; ++i) ; +// expected-error@+1 3 {{lastprivate variable cannot be firstprivate}} expected-note@+1 3 {{defined as lastprivate}} #pragma omp target teams distribute simd lastprivate(x, y, z) firstprivate(x, y, z) for (i = 0; i < 16; ++i) ; Modified: cfe/trunk/test/OpenMP/teams_distribute_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -144,8 +144,9 @@ int main(int argc, char **argv) { #pragma omp teams distribute firstprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute lastprivate(argc), firstprivate(argc) // OK +#pragma omp teams distribute lastprivate(argc), firstprivate(argc) for (i = 0; i < argc; ++i) foo(); return 0; Modified: cfe/trunk/test/OpenMP/teams_distribute_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -255,12 +255,14 @@ int main(int argc, char **argv) { #pragma omp teams distribute lastprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{firstprivate variable cannot be lastprivate}} expected-note@+2 {{defined as firstprivate}} #pragma omp target -#pragma omp teams distribute firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +#pragma omp teams distribute firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute lastprivate(n) firstprivate(n) // OK +#pragma omp teams distribute lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/teams_distribute_loop_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_loop_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_loop_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_loop_messages.cpp Fri Dec 1 09:40:15 2017 @@ -2,7 +2,7 @@ class S { int a; - S() : a(0) {} + S() : a(0) {} // expected-note {{implicitly declared private here}} public: S(int v) : a(v) {} @@ -696,8 +696,9 @@ void test_loop_eh() { void test_loop_firstprivate_lastprivate() { S s(4); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute lastprivate(s) firstprivate(s) +#pragma omp teams distribute lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} for (int i = 0; i < 16; ++i) ; } Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -144,8 +144,9 @@ int main(int argc, char **argv) { #pragma omp teams distribute parallel for firstprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute parallel for lastprivate(argc), firstprivate(argc) // OK +#pragma omp teams distribute parallel for lastprivate(argc), firstprivate(argc) for (i = 0; i < argc; ++i) foo(); return 0; Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -255,12 +255,14 @@ int main(int argc, char **argv) { #pragma omp teams distribute parallel for lastprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{firstprivate variable cannot be lastprivate}} expected-note@+2 {{defined as firstprivate}} #pragma omp target -#pragma omp teams distribute parallel for firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +#pragma omp teams distribute parallel for firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute parallel for lastprivate(n) firstprivate(n) // OK +#pragma omp teams distribute parallel for lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp Fri Dec 1 09:40:15 2017 @@ -2,7 +2,7 @@ class S { int a; - S() : a(0) {} + S() : a(0) {} // expected-note {{implicitly declared private here}} public: S(int v) : a(v) {} @@ -691,8 +691,9 @@ void test_loop_eh() { void test_loop_firstprivate_lastprivate() { S s(4); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute parallel for lastprivate(s) firstprivate(s) +#pragma omp teams distribute parallel for lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} for (int i = 0; i < 16; ++i) ; } Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -144,8 +144,9 @@ int main(int argc, char **argv) { #pragma omp teams distribute parallel for simd firstprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute parallel for simd lastprivate(argc), firstprivate(argc) // OK +#pragma omp teams distribute parallel for simd lastprivate(argc), firstprivate(argc) for (i = 0; i < argc; ++i) foo(); return 0; Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -255,12 +255,14 @@ int main(int argc, char **argv) { #pragma omp teams distribute parallel for simd lastprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{firstprivate variable cannot be lastprivate}} expected-note@+2 {{defined as firstprivate}} #pragma omp target -#pragma omp teams distribute parallel for simd firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +#pragma omp teams distribute parallel for simd firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute parallel for simd lastprivate(n) firstprivate(n) // OK +#pragma omp teams distribute parallel for simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp Fri Dec 1 09:40:15 2017 @@ -2,7 +2,7 @@ class S { int a; - S() : a(0) {} + S() : a(0) {} // expected-note {{implicitly declared private here}} public: S(int v) : a(v) {} @@ -693,8 +693,9 @@ void test_loop_eh() { void test_loop_firstprivate_lastprivate() { S s(4); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute parallel for simd lastprivate(s) firstprivate(s) +#pragma omp teams distribute parallel for simd lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} for (int i = 0; i < 16; ++i) ; } Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -144,6 +144,7 @@ int main(int argc, char **argv) { #pragma omp teams distribute simd firstprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target #pragma omp teams distribute simd lastprivate(argc), firstprivate(argc) // OK for (i = 0; i < argc; ++i) foo(); Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp Fri Dec 1 09:40:15 2017 @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -255,12 +255,14 @@ int main(int argc, char **argv) { #pragma omp teams distribute simd lastprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{firstprivate variable cannot be lastprivate}} expected-note@+2 {{defined as firstprivate}} #pragma omp target -#pragma omp teams distribute simd firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +#pragma omp teams distribute simd firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute simd lastprivate(n) firstprivate(n) // OK +#pragma omp teams distribute simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_loop_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_loop_messages.cpp?rev=319560&r1=319559&r2=319560&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_simd_loop_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_simd_loop_messages.cpp Fri Dec 1 09:40:15 2017 @@ -2,7 +2,7 @@ class S { int a; - S() : a(0) {} + S() : a(0) {} // expected-note {{implicitly declared private here}} public: S(int v) : a(v) {} @@ -693,8 +693,9 @@ void test_loop_eh() { void test_loop_firstprivate_lastprivate() { S s(4); +// expected-error@+2 {{lastprivate variable cannot be firstprivate}} expected-note@+2 {{defined as lastprivate}} #pragma omp target -#pragma omp teams distribute simd lastprivate(s) firstprivate(s) +#pragma omp teams distribute simd lastprivate(s) firstprivate(s) // expected-error {{calling a private constructor of class 'S'}} for (int i = 0; i < 16; ++i) ; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits