summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp15
-rw-r--r--clang/test/OpenMP/distribute_parallel_for_ast_print.cpp6
-rw-r--r--clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp13
-rw-r--r--clang/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp6
-rw-r--r--clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp13
-rw-r--r--clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp5
-rw-r--r--clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c3
-rw-r--r--clang/test/OpenMP/distribute_simd_ast_print.cpp4
-rw-r--r--clang/test/OpenMP/distribute_simd_firstprivate_messages.cpp13
-rw-r--r--clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp3
-rw-r--r--clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/target_teams_distribute_loop_messages.cpp5
-rw-r--r--clang/test/OpenMP/target_teams_distribute_misc_messages.c3
-rw-r--r--clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp3
-rw-r--r--clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp5
-rw-r--r--clang/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c3
-rw-r--r--clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp3
-rw-r--r--clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp5
-rw-r--r--clang/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c3
-rw-r--r--clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp3
-rw-r--r--clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp5
-rw-r--r--clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c3
-rw-r--r--clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp3
-rw-r--r--clang/test/OpenMP/teams_distribute_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/teams_distribute_loop_messages.cpp5
-rw-r--r--clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp3
-rw-r--r--clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp5
-rw-r--r--clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp3
-rw-r--r--clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp5
-rw-r--r--clang/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp1
-rw-r--r--clang/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp10
-rw-r--r--clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp5
40 files changed, 160 insertions, 102 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index f0b43f06853..2a7e2f1da49 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -9146,7 +9146,8 @@ OMPClause *Sema::ActOnOpenMPFirstprivateClause(ArrayRef<Expr *> 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<Expr *> 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<Expr *> 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/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp b/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp
index 54a3649e578..351e15803c0 100644
--- a/clang/test/OpenMP/distribute_parallel_for_ast_print.cpp
+++ b/clang/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/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp b/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
index 3e288c37d42..67075ca1293 100644
--- a/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp b/clang/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp
index ebc7a666733..b38d978cca0 100644
--- a/clang/test/OpenMP/distribute_parallel_for_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp b/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp
index 464acbe19c6..21010638be1 100644
--- a/clang/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp
+++ b/clang/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/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp b/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp
index 07d30e48312..646407643b2 100644
--- a/clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp b/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp
index e54089d3185..73450d4f118 100644
--- a/clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp b/clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp
index 1fedb3c02d7..d137d47ca2a 100644
--- a/clang/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp
+++ b/clang/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/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c b/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c
index bb24c23d4f4..4d071621fcb 100644
--- a/clang/test/OpenMP/distribute_parallel_for_simd_misc_messages.c
+++ b/clang/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/clang/test/OpenMP/distribute_simd_ast_print.cpp b/clang/test/OpenMP/distribute_simd_ast_print.cpp
index 6ac4b849a27..3246ccb46ae 100644
--- a/clang/test/OpenMP/distribute_simd_ast_print.cpp
+++ b/clang/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/clang/test/OpenMP/distribute_simd_firstprivate_messages.cpp b/clang/test/OpenMP/distribute_simd_firstprivate_messages.cpp
index b9267a3037f..f0c293b78d8 100644
--- a/clang/test/OpenMP/distribute_simd_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp b/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp
index a8914350bf5..82ce15e5504 100644
--- a/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp
index 602e039802d..934149e7c13 100644
--- a/clang/test/OpenMP/target_teams_distribute_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp
index 5cfe7825c85..898291833d2 100644
--- a/clang/test/OpenMP/target_teams_distribute_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_loop_messages.cpp b/clang/test/OpenMP/target_teams_distribute_loop_messages.cpp
index 441abcba004..0a825ab1e60 100644
--- a/clang/test/OpenMP/target_teams_distribute_loop_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_misc_messages.c b/clang/test/OpenMP/target_teams_distribute_misc_messages.c
index bf4df0894ad..33496a70d14 100644
--- a/clang/test/OpenMP/target_teams_distribute_misc_messages.c
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp
index d4e708308a0..0d835504783 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp
index ccecb638ca1..84a6df28174 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp
index d912737a214..57ab273c460 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c b/clang/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c
index 769be6c10c3..c48a2dfa9e6 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_misc_messages.c
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp
index d26044abc81..4790b4bffda 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp
index 7f17d679e0c..156f1a66c19 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp
index 0ed57baa5c3..a16dec190dd 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c
index 5c02ee38806..1ea02f6d2b5 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_misc_messages.c
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp
index b9b039efd92..235533b49d1 100644
--- a/clang/test/OpenMP/target_teams_distribute_simd_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp
index b8b1916f1e3..a143dc2fd88 100644
--- a/clang/test/OpenMP/target_teams_distribute_simd_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp
index aae00a4433b..09aa548bd5c 100644
--- a/clang/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp
+++ b/clang/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/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c b/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c
index 4a7adb62e86..70ec508f679 100644
--- a/clang/test/OpenMP/target_teams_distribute_simd_misc_messages.c
+++ b/clang/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/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp b/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp
index a7108077433..1a2b5f3782f 100644
--- a/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_lastprivate_messages.cpp b/clang/test/OpenMP/teams_distribute_lastprivate_messages.cpp
index 6941197beee..392607ea14b 100644
--- a/clang/test/OpenMP/teams_distribute_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_loop_messages.cpp b/clang/test/OpenMP/teams_distribute_loop_messages.cpp
index fcec84e9d3a..acab1f76a2d 100644
--- a/clang/test/OpenMP/teams_distribute_loop_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp b/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp
index e6314c210e8..90e78defc5e 100644
--- a/clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp b/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp
index c5f457a0b2c..b58bac4fdfc 100644
--- a/clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp b/clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp
index e0c315f513b..a2f6f679d32 100644
--- a/clang/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp b/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp
index cbbb313c06b..668337db454 100644
--- a/clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp b/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp
index 62f8559adda..204be4c95e9 100644
--- a/clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp b/clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp
index 03325623502..66361b64eb8 100644
--- a/clang/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp b/clang/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp
index 324672c1412..bcc0e351c66 100644
--- a/clang/test/OpenMP/teams_distribute_simd_firstprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp b/clang/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp
index 8bdb3805ab2..51dbfef2293 100644
--- a/clang/test/OpenMP/teams_distribute_simd_lastprivate_messages.cpp
+++ b/clang/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/clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp b/clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp
index 81fbfe860a7..60e07a3db59 100644
--- a/clang/test/OpenMP/teams_distribute_simd_loop_messages.cpp
+++ b/clang/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)
;
}
OpenPOWER on IntegriCloud