summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/simd_loop_messages.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-06-28 15:16:37 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-06-28 15:16:37 +0000
commitb7c31ff4a22e05da367503f5f7e845d1a98169a5 (patch)
treedf8eb2947a0caf24d3592ff6c88b6d6ca31d8846 /clang/test/OpenMP/simd_loop_messages.cpp
parent9fab46ca0bd38babf7b1a441d44389dcb66a1935 (diff)
downloadbcm5719-llvm-b7c31ff4a22e05da367503f5f7e845d1a98169a5.tar.gz
bcm5719-llvm-b7c31ff4a22e05da367503f5f7e845d1a98169a5.zip
[OPENMP]Fix DSA for loop iteration variables in simd loops.
According to the OpenMP 5.0 standard, the loop iteration variable in the associated for-loop of a simd construct with just one associated for-loop may be listed in a private, lastprivate, or linear clause with a linear-step that is the increment of the associated for-loop. Also, the loop teration variables in the associated for-loops of a simd construct with multiple associated for-loops may be listed in a private or lastprivate clause. llvm-svn: 364650
Diffstat (limited to 'clang/test/OpenMP/simd_loop_messages.cpp')
-rw-r--r--clang/test/OpenMP/simd_loop_messages.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/clang/test/OpenMP/simd_loop_messages.cpp b/clang/test/OpenMP/simd_loop_messages.cpp
index 4c4ce5f98c2..81340203748 100644
--- a/clang/test/OpenMP/simd_loop_messages.cpp
+++ b/clang/test/OpenMP/simd_loop_messages.cpp
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -fopenmp-version=50 -DOMP50
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -fopenmp-version=50 -DOMP50
static int sii;
// expected-note@+1 {{defined as threadprivate or thread local}}
@@ -239,12 +241,22 @@ int test_iteration_spaces() {
for (ii = 0; (ii < 10); (ii-=0))
c[ii] = a[ii];
- // expected-note@+2 {{defined as private}}
- // expected-error@+2 {{loop iteration variable in the associated loop of 'omp simd' directive may not be private, predetermined as linear}}
+#ifndef OMP50
+ // expected-note@+3 {{defined as private}}
+ // expected-error@+3 {{loop iteration variable in the associated loop of 'omp simd' directive may not be private, predetermined as linear}}
+#endif // OMP50
#pragma omp simd private(ii)
for (ii = 0; ii < 10; ii++)
c[ii] = a[ii];
+#ifndef OMP50
+ // expected-note@+3 {{defined as lastprivate}}
+ // expected-error@+3 {{loop iteration variable in the associated loop of 'omp simd' directive may not be lastprivate, predetermined as linear}}
+#endif // OMP50
+ #pragma omp simd lastprivate(ii)
+ for (ii = 0; ii < 10; ii++)
+ c[ii] = a[ii];
+
// expected-error@+1 {{unexpected OpenMP clause 'shared' in directive '#pragma omp simd'}}
#pragma omp simd shared(ii)
for (ii = 0; ii < 10; ii++)
OpenPOWER on IntegriCloud