From e05cbf9fd88c77c1a454b45ef3e0e8978e7bd979 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 1 Dec 2017 17:40:15 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319560 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaOpenMP.cpp | 15 +++++---------- test/OpenMP/distribute_parallel_for_ast_print.cpp | 6 +++--- ...tribute_parallel_for_firstprivate_messages.cpp | 13 ++++++++----- ...stribute_parallel_for_lastprivate_messages.cpp | 10 ++++++---- .../distribute_parallel_for_simd_ast_print.cpp | 6 +++--- ...te_parallel_for_simd_firstprivate_messages.cpp | 13 ++++++++----- ...ute_parallel_for_simd_lastprivate_messages.cpp | 10 ++++++---- ...distribute_parallel_for_simd_loop_messages.cpp | 5 +++-- .../distribute_parallel_for_simd_misc_messages.c | 3 +++ test/OpenMP/distribute_simd_ast_print.cpp | 4 ++-- .../distribute_simd_firstprivate_messages.cpp | 13 ++++++++----- .../distribute_simd_lastprivate_messages.cpp | 10 ++++++---- ...get_teams_distribute_firstprivate_messages.cpp | 3 ++- ...rget_teams_distribute_lastprivate_messages.cpp | 10 ++++++---- .../target_teams_distribute_loop_messages.cpp | 5 +++-- .../target_teams_distribute_misc_messages.c | 3 +++ ...tribute_parallel_for_firstprivate_messages.cpp | 3 ++- ...stribute_parallel_for_lastprivate_messages.cpp | 10 ++++++---- ...eams_distribute_parallel_for_loop_messages.cpp | 5 +++-- ..._teams_distribute_parallel_for_misc_messages.c | 3 +++ ...te_parallel_for_simd_firstprivate_messages.cpp | 3 ++- ...ute_parallel_for_simd_lastprivate_messages.cpp | 10 ++++++---- ...distribute_parallel_for_simd_loop_messages.cpp | 5 +++-- ...s_distribute_parallel_for_simd_misc_messages.c | 3 +++ ...eams_distribute_simd_firstprivate_messages.cpp | 3 ++- ...teams_distribute_simd_lastprivate_messages.cpp | 10 ++++++---- ...target_teams_distribute_simd_loop_messages.cpp | 5 +++-- .../target_teams_distribute_simd_misc_messages.c | 3 +++ .../teams_distribute_firstprivate_messages.cpp | 3 ++- .../teams_distribute_lastprivate_messages.cpp | 10 ++++++---- test/OpenMP/teams_distribute_loop_messages.cpp | 5 +++-- ...tribute_parallel_for_firstprivate_messages.cpp | 3 ++- ...stribute_parallel_for_lastprivate_messages.cpp | 10 ++++++---- ...eams_distribute_parallel_for_loop_messages.cpp | 5 +++-- ...te_parallel_for_simd_firstprivate_messages.cpp | 3 ++- ...ute_parallel_for_simd_lastprivate_messages.cpp | 10 ++++++---- ...distribute_parallel_for_simd_loop_messages.cpp | 5 +++-- ...eams_distribute_simd_firstprivate_messages.cpp | 1 + ...teams_distribute_simd_lastprivate_messages.cpp | 10 ++++++---- .../teams_distribute_simd_loop_messages.cpp | 5 +++-- 40 files changed, 160 insertions(+), 102 deletions(-) diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index f0b43f0685..2a7e2f1da4 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -9146,7 +9146,8 @@ OMPClause *Sema::ActOnOpenMPFirstprivateClause(ArrayRef VarList, // 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::ActOnOpenMPFirstprivateClause(ArrayRef VarList, // 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::ActOnOpenMPLastprivateClause(ArrayRef VarList, // 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) diff --git a/test/OpenMP/distribute_parallel_for_ast_print.cpp b/test/OpenMP/distribute_parallel_for_ast_print.cpp index 54a3649e57..351e15803c 100644 --- a/test/OpenMP/distribute_parallel_for_ast_print.cpp +++ b/test/OpenMP/distribute_parallel_for_ast_print.cpp @@ -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) diff --git a/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp b/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp index 3e288c37d4..67075ca129 100644 --- a/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp @@ -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 diff --git a/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp b/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp index ebc7a66673..b38d978cca 100644 --- a/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp b/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp index 464acbe19c..21010638be 100644 --- a/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp @@ -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) diff --git a/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp index 07d30e4831..646407643b 100644 --- a/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp @@ -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 diff --git a/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp index e54089d318..73450d4f11 100644 --- a/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp index 1fedb3c02d..d137d47ca2 100644 --- a/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp @@ -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) ; } diff --git a/test/OpenMP/distribute_parallel_for_simd_misc_messages.c b/test/OpenMP/distribute_parallel_for_simd_misc_messages.c index bb24c23d4f..4d071621fc 100644 --- a/test/OpenMP/distribute_parallel_for_simd_misc_messages.c +++ b/test/OpenMP/distribute_parallel_for_simd_misc_messages.c @@ -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) diff --git a/test/OpenMP/distribute_simd_ast_print.cpp b/test/OpenMP/distribute_simd_ast_print.cpp index 6ac4b849a2..3246ccb46a 100644 --- a/test/OpenMP/distribute_simd_ast_print.cpp +++ b/test/OpenMP/distribute_simd_ast_print.cpp @@ -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) diff --git a/test/OpenMP/distribute_simd_firstprivate_messages.cpp b/test/OpenMP/distribute_simd_firstprivate_messages.cpp index b9267a3037..f0c293b78d 100644 --- a/test/OpenMP/distribute_simd_firstprivate_messages.cpp +++ b/test/OpenMP/distribute_simd_firstprivate_messages.cpp @@ -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 diff --git a/test/OpenMP/distribute_simd_lastprivate_messages.cpp b/test/OpenMP/distribute_simd_lastprivate_messages.cpp index a8914350bf..82ce15e550 100644 --- a/test/OpenMP/distribute_simd_lastprivate_messages.cpp +++ b/test/OpenMP/distribute_simd_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp index 602e039802..934149e7c1 100644 --- a/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp index 5cfe7825c8..898291833d 100644 --- a/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/target_teams_distribute_loop_messages.cpp b/test/OpenMP/target_teams_distribute_loop_messages.cpp index 441abcba00..0a825ab1e6 100644 --- a/test/OpenMP/target_teams_distribute_loop_messages.cpp +++ b/test/OpenMP/target_teams_distribute_loop_messages.cpp @@ -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) ; } diff --git a/test/OpenMP/target_teams_distribute_misc_messages.c b/test/OpenMP/target_teams_distribute_misc_messages.c index bf4df0894a..33496a70d1 100644 --- a/test/OpenMP/target_teams_distribute_misc_messages.c +++ b/test/OpenMP/target_teams_distribute_misc_messages.c @@ -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) ; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp index d4e708308a..0d83550478 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp index ccecb638ca..84a6df2817 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp index d912737a21..57ab273c46 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp @@ -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) ; } diff --git a/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c b/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c index 769be6c10c..c48a2dfa9e 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c +++ b/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c @@ -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) ; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp index d26044abc8..4790b4bffd 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp index 7f17d679e0..156f1a66c1 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp index 0ed57baa5c..a16dec190d 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp @@ -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) ; } diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c b/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c index 5c02ee3880..1ea02f6d2b 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c @@ -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) ; diff --git a/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp b/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp index b9b039efd9..235533b49d 100644 --- a/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp @@ -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}} diff --git a/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp b/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp index b8b1916f1e..a143dc2fd8 100644 --- a/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp b/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp index aae00a4433..09aa548bd5 100644 --- a/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp @@ -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) ; } diff --git a/test/OpenMP/target_teams_distribute_simd_misc_messages.c b/test/OpenMP/target_teams_distribute_simd_misc_messages.c index 4a7adb62e8..70ec508f67 100644 --- a/test/OpenMP/target_teams_distribute_simd_misc_messages.c +++ b/test/OpenMP/target_teams_distribute_simd_misc_messages.c @@ -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) ; diff --git a/test/OpenMP/teams_distribute_firstprivate_messages.cpp b/test/OpenMP/teams_distribute_firstprivate_messages.cpp index a710807743..1a2b5f3782 100644 --- a/test/OpenMP/teams_distribute_firstprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_firstprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/teams_distribute_lastprivate_messages.cpp b/test/OpenMP/teams_distribute_lastprivate_messages.cpp index 6941197bee..392607ea14 100644 --- a/test/OpenMP/teams_distribute_lastprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/teams_distribute_loop_messages.cpp b/test/OpenMP/teams_distribute_loop_messages.cpp index fcec84e9d3..acab1f76a2 100644 --- a/test/OpenMP/teams_distribute_loop_messages.cpp +++ b/test/OpenMP/teams_distribute_loop_messages.cpp @@ -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) ; } diff --git a/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp index e6314c210e..90e78defc5 100644 --- a/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp index c5f457a0b2..b58bac4fdf 100644 --- a/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp index e0c315f513..a2f6f679d3 100644 --- a/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp @@ -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) ; } diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp index cbbb313c06..668337db45 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp index 62f8559add..204be4c95e 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp index 0332562350..66361b64eb 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp @@ -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) ; } diff --git a/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp b/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp index 324672c141..bcc0e351c6 100644 --- a/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp @@ -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(); diff --git a/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp b/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp index 8bdb3805ab..51dbfef229 100644 --- a/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp @@ -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; diff --git a/test/OpenMP/teams_distribute_simd_loop_messages.cpp b/test/OpenMP/teams_distribute_simd_loop_messages.cpp index 81fbfe860a..60e07a3db5 100644 --- a/test/OpenMP/teams_distribute_simd_loop_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_loop_messages.cpp @@ -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) ; } -- 2.50.1