summaryrefslogtreecommitdiffstats
path: root/test/OpenMP
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-12-25 13:38:08 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-12-25 13:38:08 +0000
commitee1775e00f7b7e6b6dc3e110dd6368f276031bfb (patch)
tree36564cf0bc6cecfcad4a96c7ba2394713893ad20 /test/OpenMP
parent794a77e319dc84fc3faaa1ed0086f580bbf6d1ab (diff)
[OPENMP] Do not allow to use threadprivate or thread local variables as loop iteration variables.
According to OpenMP the loop iteration variable may not appear in a threadprivate directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP')
-rw-r--r--test/OpenMP/for_loop_messages.cpp2
-rw-r--r--test/OpenMP/for_simd_loop_messages.cpp2
-rw-r--r--test/OpenMP/parallel_for_loop_messages.cpp2
-rw-r--r--test/OpenMP/parallel_for_simd_loop_messages.cpp2
-rw-r--r--test/OpenMP/simd_loop_messages.cpp2
-rw-r--r--test/OpenMP/taskloop_loop_messages.cpp2
-rw-r--r--test/OpenMP/taskloop_simd_loop_messages.cpp2
7 files changed, 14 insertions, 0 deletions
diff --git a/test/OpenMP/for_loop_messages.cpp b/test/OpenMP/for_loop_messages.cpp
index 7f0b114101..895baf57e9 100644
--- a/test/OpenMP/for_loop_messages.cpp
+++ b/test/OpenMP/for_loop_messages.cpp
@@ -10,6 +10,7 @@ public:
};
static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
#pragma omp threadprivate(sii)
static int globalii;
@@ -309,6 +310,7 @@ int test_iteration_spaces() {
#pragma omp parallel
{
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp for' directive may not be threadprivate or thread local, predetermined as private}}
#pragma omp for
for (sii = 0; sii < 10; sii += 1)
c[sii] = a[sii];
diff --git a/test/OpenMP/for_simd_loop_messages.cpp b/test/OpenMP/for_simd_loop_messages.cpp
index d336888d2b..958c7f60d0 100644
--- a/test/OpenMP/for_simd_loop_messages.cpp
+++ b/test/OpenMP/for_simd_loop_messages.cpp
@@ -10,6 +10,7 @@ public:
};
static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
#pragma omp threadprivate(sii)
static int globalii;
@@ -306,6 +307,7 @@ int test_iteration_spaces() {
#pragma omp parallel
{
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp for simd' directive may not be threadprivate or thread local, predetermined as linear}}
#pragma omp for simd
for (sii = 0; sii < 10; sii += 1)
c[sii] = a[sii];
diff --git a/test/OpenMP/parallel_for_loop_messages.cpp b/test/OpenMP/parallel_for_loop_messages.cpp
index 2a65d781a0..2bb32bdfc1 100644
--- a/test/OpenMP/parallel_for_loop_messages.cpp
+++ b/test/OpenMP/parallel_for_loop_messages.cpp
@@ -10,6 +10,7 @@ public:
};
static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
#pragma omp threadprivate(sii)
static int globalii;
@@ -257,6 +258,7 @@ int test_iteration_spaces() {
c[ii] = a[ii];
{
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel for' directive may not be threadprivate or thread local, predetermined as private}}
#pragma omp parallel for
for (sii = 0; sii < 10; sii += 1)
c[sii] = a[sii];
diff --git a/test/OpenMP/parallel_for_simd_loop_messages.cpp b/test/OpenMP/parallel_for_simd_loop_messages.cpp
index 8fe58434bc..f4929d97d4 100644
--- a/test/OpenMP/parallel_for_simd_loop_messages.cpp
+++ b/test/OpenMP/parallel_for_simd_loop_messages.cpp
@@ -10,6 +10,7 @@ public:
};
static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
#pragma omp threadprivate(sii)
static int globalii;
@@ -259,6 +260,7 @@ int test_iteration_spaces() {
c[ii] = a[ii];
{
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp parallel for simd' directive may not be threadprivate or thread local, predetermined as linear}}
#pragma omp parallel for simd
for (sii = 0; sii < 10; sii += 1)
c[sii] = a[sii];
diff --git a/test/OpenMP/simd_loop_messages.cpp b/test/OpenMP/simd_loop_messages.cpp
index 677f2b9a2e..96b4cafc6b 100644
--- a/test/OpenMP/simd_loop_messages.cpp
+++ b/test/OpenMP/simd_loop_messages.cpp
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
#pragma omp threadprivate(sii)
static int globalii;
@@ -252,6 +253,7 @@ int test_iteration_spaces() {
#pragma omp parallel
{
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp simd' directive may not be threadprivate or thread local, predetermined as linear}}
#pragma omp simd
for (sii = 0; sii < 10; sii+=1)
c[sii] = a[sii];
diff --git a/test/OpenMP/taskloop_loop_messages.cpp b/test/OpenMP/taskloop_loop_messages.cpp
index 3ff8005f7f..02518e572f 100644
--- a/test/OpenMP/taskloop_loop_messages.cpp
+++ b/test/OpenMP/taskloop_loop_messages.cpp
@@ -10,6 +10,7 @@ public:
};
static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
#pragma omp threadprivate(sii)
static int globalii;
@@ -310,6 +311,7 @@ int test_iteration_spaces() {
#pragma omp parallel
{
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp taskloop' directive may not be threadprivate or thread local, predetermined as private}}
#pragma omp taskloop
for (sii = 0; sii < 10; sii += 1)
c[sii] = a[sii];
diff --git a/test/OpenMP/taskloop_simd_loop_messages.cpp b/test/OpenMP/taskloop_simd_loop_messages.cpp
index 34da10b712..4731872110 100644
--- a/test/OpenMP/taskloop_simd_loop_messages.cpp
+++ b/test/OpenMP/taskloop_simd_loop_messages.cpp
@@ -10,6 +10,7 @@ public:
};
static int sii;
+// expected-note@+1 {{defined as threadprivate or thread local}}
#pragma omp threadprivate(sii)
static int globalii;
@@ -311,6 +312,7 @@ int test_iteration_spaces() {
#pragma omp parallel
{
+// expected-error@+2 {{loop iteration variable in the associated loop of 'omp taskloop simd' directive may not be threadprivate or thread local, predetermined as linear}}
#pragma omp taskloop simd
for (sii = 0; sii < 10; sii += 1)
c[sii] = a[sii];