r350441 - [OpenMP] Refactor const restriction for linear
Joel E. Denny via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 4 14:12:13 PST 2019
Author: jdenny
Date: Fri Jan 4 14:12:13 2019
New Revision: 350441
URL: http://llvm.org/viewvc/llvm-project?rev=350441&view=rev
Log:
[OpenMP] Refactor const restriction for linear
As discussed in D56113, this patch refactors the implementation of the
const restriction for linear to reuse a function introduced by D56113.
A side effect is that, if a variable has mutable members, this
diagnostic is now skipped, and the diagnostic for the variable not
being an integer or pointer is reported instead.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D56299
Modified:
cfe/trunk/lib/Sema/SemaOpenMP.cpp
cfe/trunk/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp
cfe/trunk/test/OpenMP/distribute_simd_linear_messages.cpp
cfe/trunk/test/OpenMP/for_linear_messages.cpp
cfe/trunk/test/OpenMP/for_simd_linear_messages.cpp
cfe/trunk/test/OpenMP/parallel_for_linear_messages.cpp
cfe/trunk/test/OpenMP/parallel_for_simd_linear_messages.cpp
cfe/trunk/test/OpenMP/simd_linear_messages.cpp
cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp
cfe/trunk/test/OpenMP/target_parallel_for_simd_linear_messages.cpp
cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp
cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp
cfe/trunk/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp
cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp
cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp
cfe/trunk/test/OpenMP/teams_distribute_simd_linear_messages.cpp
Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Fri Jan 4 14:12:13 2019
@@ -11531,20 +11531,12 @@ bool Sema::CheckOpenMPLinearDecl(const V
}
Type = Type.getNonReferenceType();
- // A list item must not be const-qualified.
- if (Type.isConstant(Context)) {
- Diag(ELoc, diag::err_omp_const_variable)
- << getOpenMPClauseName(OMPC_linear);
- if (D) {
- bool IsDecl =
- !VD ||
- VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
- Diag(D->getLocation(),
- IsDecl ? diag::note_previous_decl : diag::note_defined_here)
- << D;
- }
+ // OpenMP 5.0 [2.19.3, List Item Privatization, Restrictions]
+ // A variable that is privatized must not have a const-qualified type
+ // unless it is of class type with a mutable member. This restriction does
+ // not apply to the firstprivate clause.
+ if (rejectConstNotMutableType(*this, D, Type, OMPC_linear, ELoc))
return true;
- }
// A list item must be of integral or pointer type.
Type = Type.getUnqualifiedType().getCanonicalType();
Modified: cfe/trunk/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_parallel_for_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -189,7 +189,7 @@ template<class I, class C> int foomain(I
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
+#pragma omp distribute parallel for simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
@@ -294,7 +294,7 @@ int main(int argc, char **argv) {
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}} expected-error {{incomplete type 'S1' where a complete type is required}}
+#pragma omp distribute parallel for simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
Modified: cfe/trunk/test/OpenMP/distribute_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/distribute_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/distribute_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -189,7 +189,7 @@ template<class I, class C> int foomain(I
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
+#pragma omp distribute simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
@@ -283,7 +283,7 @@ int main(int argc, char **argv) {
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-error {{incomplete type 'S1' where a complete type is required}}
+#pragma omp distribute simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
Modified: cfe/trunk/test/OpenMP/for_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -122,7 +122,7 @@ template<class I, class C> int foomain(I
#pragma omp for linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
- // expected-error at +1 {{const-qualified variable cannot be linear}}
+ // expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp for linear (a, b:B::ib)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp for linear (argv[1]) // expected-error {{expected variable name}}
@@ -188,7 +188,7 @@ int main(int argc, char **argv) {
#pragma omp for linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
- // expected-error at +1 {{const-qualified variable cannot be linear}}
+ // expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp for linear(a, b)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp for linear (argv[1]) // expected-error {{expected variable name}}
Modified: cfe/trunk/test/OpenMP/for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/for_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -122,7 +122,7 @@ template<class I, class C> int foomain(I
#pragma omp for simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
- // expected-error at +1 {{const-qualified variable cannot be linear}}
+ // expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp for simd linear (a, b:B::ib)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp for simd linear (argv[1]) // expected-error {{expected variable name}}
@@ -186,7 +186,7 @@ int main(int argc, char **argv) {
#pragma omp for simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
- // expected-error at +1 {{const-qualified variable cannot be linear}}
+ // expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp for simd linear (a, b)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp for simd linear (argv[1]) // expected-error {{expected variable name}}
Modified: cfe/trunk/test/OpenMP/parallel_for_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -146,7 +146,7 @@ int foomain(I argc, C **argv) {
for (int k = 0; k < argc; ++k)
++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
-// expected-error at +1 {{const-qualified variable cannot be linear}}
+// expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp parallel for linear(a, b : B::ib)
for (int k = 0; k < argc; ++k)
++k;
@@ -231,7 +231,7 @@ int main(int argc, char **argv) {
for (int k = 0; k < argc; ++k)
++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
-// expected-error at +1 {{const-qualified variable cannot be linear}}
+// expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp parallel for linear(a, b)
for (int k = 0; k < argc; ++k)
++k;
Modified: cfe/trunk/test/OpenMP/parallel_for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/parallel_for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/parallel_for_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -122,7 +122,7 @@ template<class I, class C> int foomain(I
#pragma omp parallel for simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
- // expected-error at +1 {{const-qualified variable cannot be linear}}
+ // expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp parallel for simd linear (a, b:B::ib)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp parallel for simd linear (argv[1]) // expected-error {{expected variable name}}
@@ -186,7 +186,7 @@ int main(int argc, char **argv) {
#pragma omp parallel for simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
- // expected-error at +1 {{const-qualified variable cannot be linear}}
+ // expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp parallel for simd linear (a, b)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp parallel for simd linear (argv[1]) // expected-error {{expected variable name}}
Modified: cfe/trunk/test/OpenMP/simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -132,7 +132,7 @@ template<class I, class C> int foomain(I
#pragma omp simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
- // expected-error at +1 {{const-qualified variable cannot be linear}}
+ // expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp simd linear (val(a, b):B::ib)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp simd linear (argv[1]) // expected-error {{expected variable name}}
@@ -221,7 +221,7 @@ int main(int argc, char **argv) {
#pragma omp simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
- // expected-error at +1 {{const-qualified variable cannot be linear}}
+ // expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp simd linear(a, b)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp simd linear (argv[1]) // expected-error {{expected variable name}}
Modified: cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -146,7 +146,7 @@ int foomain(I argc, C **argv) {
for (int k = 0; k < argc; ++k)
++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
-// expected-error at +1 {{const-qualified variable cannot be linear}}
+// expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp target parallel for linear(a, b : B::ib)
for (int k = 0; k < argc; ++k)
++k;
@@ -231,7 +231,7 @@ int main(int argc, char **argv) {
for (int k = 0; k < argc; ++k)
++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
-// expected-error at +1 {{const-qualified variable cannot be linear}}
+// expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp target parallel for linear(a, b)
for (int k = 0; k < argc; ++k)
++k;
Modified: cfe/trunk/test/OpenMP/target_parallel_for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_parallel_for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_parallel_for_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -146,7 +146,7 @@ int foomain(I argc, C **argv) {
for (int k = 0; k < argc; ++k)
++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
-// expected-error at +1 {{const-qualified variable cannot be linear}}
+// expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp target parallel for simd linear(a, b : B::ib)
for (int k = 0; k < argc; ++k)
++k;
@@ -231,7 +231,7 @@ int main(int argc, char **argv) {
for (int k = 0; k < argc; ++k)
++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
-// expected-error at +1 {{const-qualified variable cannot be linear}}
+// expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp target parallel for simd linear(a, b)
for (int k = 0; k < argc; ++k)
++k;
Modified: cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -146,7 +146,7 @@ int foomain(I argc, C **argv) {
for (int k = 0; k < argc; ++k)
++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
-// expected-error at +1 {{const-qualified variable cannot be linear}}
+// expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp target simd linear(a, b : B::ib)
for (int k = 0; k < argc; ++k)
++k;
@@ -231,7 +231,7 @@ int main(int argc, char **argv) {
for (int k = 0; k < argc; ++k)
++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
-// expected-error at +1 {{const-qualified variable cannot be linear}}
+// expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp target simd linear(a, b)
for (int k = 0; k < argc; ++k)
++k;
Modified: cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -148,7 +148,7 @@ template<class I, class C> int foomain(I
#pragma omp target teams distribute parallel for simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
-#pragma omp target teams distribute parallel for simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
+#pragma omp target teams distribute parallel for simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target teams distribute parallel for simd linear (argv[1]) // expected-error {{expected variable name}}
@@ -216,7 +216,7 @@ int main(int argc, char **argv) {
for (int k = 0; k < argc; ++k) ++k;
-#pragma omp target teams distribute parallel for simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
+#pragma omp target teams distribute parallel for simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target teams distribute parallel for simd linear (argv[1]) // expected-error {{expected variable name}}
Modified: cfe/trunk/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_distribute_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -148,7 +148,7 @@ template<class I, class C> int foomain(I
#pragma omp target teams distribute simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
-#pragma omp target teams distribute simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
+#pragma omp target teams distribute simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target teams distribute simd linear (argv[1]) // expected-error {{expected variable name}}
@@ -216,7 +216,7 @@ int main(int argc, char **argv) {
for (int k = 0; k < argc; ++k) ++k;
-#pragma omp target teams distribute simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
+#pragma omp target teams distribute simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target teams distribute simd linear (argv[1]) // expected-error {{expected variable name}}
Modified: cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -132,7 +132,7 @@ template<class I, class C> int foomain(I
#pragma omp taskloop simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
- // expected-error at +1 {{const-qualified variable cannot be linear}}
+ // expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp taskloop simd linear (val(a, b):B::ib)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp taskloop simd linear (argv[1]) // expected-error {{expected variable name}}
@@ -221,7 +221,7 @@ int main(int argc, char **argv) {
#pragma omp taskloop simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error at +2 {{linear variable with incomplete type 'S1'}}
- // expected-error at +1 {{const-qualified variable cannot be linear}}
+ // expected-error at +1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
#pragma omp taskloop simd linear(a, b)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp taskloop simd linear (argv[1]) // expected-error {{expected variable name}}
Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -169,7 +169,7 @@ template<class I, class C> int foomain(I
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
-#pragma omp teams distribute parallel for simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
+#pragma omp teams distribute parallel for simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
#pragma omp target
-#pragma omp teams distribute parallel for simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
+#pragma omp teams distribute parallel for simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_linear_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_linear_messages.cpp?rev=350441&r1=350440&r2=350441&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/teams_distribute_simd_linear_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/teams_distribute_simd_linear_messages.cpp Fri Jan 4 14:12:13 2019
@@ -169,7 +169,7 @@ template<class I, class C> int foomain(I
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
-#pragma omp teams distribute simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
+#pragma omp teams distribute simd linear (a, b:B::ib) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
#pragma omp target
-#pragma omp teams distribute simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{const-qualified variable cannot be linear}}
+#pragma omp teams distribute simd linear (a, b) // expected-error {{linear variable with incomplete type 'S1'}} expected-error {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
More information about the cfe-commits
mailing list