summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/for_simd_firstprivate_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/OpenMP/for_simd_firstprivate_messages.cpp')
-rw-r--r--test/OpenMP/for_simd_firstprivate_messages.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/OpenMP/for_simd_firstprivate_messages.cpp b/test/OpenMP/for_simd_firstprivate_messages.cpp
index 1345bfc..6b49b11 100644
--- a/test/OpenMP/for_simd_firstprivate_messages.cpp
+++ b/test/OpenMP/for_simd_firstprivate_messages.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s
+// RUN: %clang_cc1 -verify -fopenmp %s
void foo() {
}
@@ -152,6 +152,14 @@ int foomain(int argc, char **argv) {
return 0;
}
+namespace A {
+double x;
+#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
+}
+namespace B {
+using A::x;
+}
+
int main(int argc, char **argv) {
const int d = 5;
const int da[5] = {0};
@@ -247,6 +255,10 @@ int main(int argc, char **argv) {
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
+#pragma omp for simd firstprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
+#pragma omp parallel
#pragma omp for simd private(xa), firstprivate(xa) // expected-error {{private variable cannot be firstprivate}} expected-note {{defined as private}}
for (i = 0; i < argc; ++i)
foo();
OpenPOWER on IntegriCloud