summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/target_simd_loop_messages.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-09-11 15:44:06 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-09-11 15:44:06 +0000
commit1be634044ddb1286e3f1759adf62c0755c3552bd (patch)
tree40732ab132eb52d4c14401a744ccf1305fd4295e /clang/test/OpenMP/target_simd_loop_messages.cpp
parent00c1ee48e4cf2a6ce67dc96342b1b07625d0a7b4 (diff)
downloadbcm5719-llvm-1be634044ddb1286e3f1759adf62c0755c3552bd.tar.gz
bcm5719-llvm-1be634044ddb1286e3f1759adf62c0755c3552bd.zip
[OPENMP] Update the diagnosis message for canonical loop form, by Chi
Chun Chen. The previous patch (https://reviews.llvm.org/D54441) support the relational-op != very well for openmp canonical loop form, however, it didn't update the diagnosis message. So this patch is simply update the diagnosis message by adding !=, update the test related to it, and update the section number for canonical loop form for OpenMP 5.0 in comment. Differential Revision: https://reviews.llvm.org/D66559 llvm-svn: 371631
Diffstat (limited to 'clang/test/OpenMP/target_simd_loop_messages.cpp')
-rw-r--r--clang/test/OpenMP/target_simd_loop_messages.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/clang/test/OpenMP/target_simd_loop_messages.cpp b/clang/test/OpenMP/target_simd_loop_messages.cpp
index e634bd58574..48fd7719eab 100644
--- a/clang/test/OpenMP/target_simd_loop_messages.cpp
+++ b/clang/test/OpenMP/target_simd_loop_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp4 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify=expected,omp5 %s -Wno-openmp-target -Wuninitialized
class S {
int a;
@@ -92,28 +94,28 @@ int test_iteration_spaces() {
for (((ii)) = 0; ii < 10; ++ii)
c[ii] = a[ii];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target simd
for (int i = 0; i; i++)
c[i] = a[i];
-// expected-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+3 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
// expected-error@+2 {{increment clause of OpenMP for loop must perform simple addition or subtraction on loop variable 'i'}}
#pragma omp target simd
for (int i = 0; jj < kk; ii++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target simd
for (int i = 0; !!i; i++)
c[i] = a[i];
-// Ok
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
#pragma omp target simd
for (int i = 0; i != 1; i++)
c[i] = a[i];
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'i'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'i'}}
#pragma omp target simd
for (int i = 0;; i++)
c[i] = a[i];
@@ -249,14 +251,14 @@ int test_iteration_spaces() {
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-note@+2 {{defined as private}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target simd' directive may not be private, predetermined as linear}}
+// omp4-note@+2 {{defined as private}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp target simd' directive may not be private, predetermined as linear}}
#pragma omp target simd private(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
-// expected-note@+2 {{defined as lastprivate}}
-// expected-error@+2 {{loop iteration variable in the associated loop of 'omp target simd' directive may not be lastprivate, predetermined as linear}}
+// omp4-note@+2 {{defined as lastprivate}}
+// omp4-error@+2 {{loop iteration variable in the associated loop of 'omp target simd' directive may not be lastprivate, predetermined as linear}}
#pragma omp target simd lastprivate(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
@@ -418,15 +420,15 @@ int test_with_random_access_iterator() {
#pragma omp target simd
for (begin = end; begin < end; ++begin)
++begin;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target simd
for (GoodIter I = begin; I - I; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target simd
for (GoodIter I = begin; begin < end; ++I)
++I;
-// expected-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}}
+// omp4-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', or '>=') of loop variable 'I'}} omp5-error@+2 {{condition of OpenMP for loop must be a relational comparison ('<', '<=', '>', '>=', or '!=') of loop variable 'I'}}
#pragma omp target simd
for (GoodIter I = begin; !I; ++I)
++I;
OpenPOWER on IntegriCloud