summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/for_firstprivate_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/OpenMP/for_firstprivate_messages.cpp')
-rw-r--r--clang/test/OpenMP/for_firstprivate_messages.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/OpenMP/for_firstprivate_messages.cpp b/clang/test/OpenMP/for_firstprivate_messages.cpp
index 2c68b9c9b23..a7333718c59 100644
--- a/clang/test/OpenMP/for_firstprivate_messages.cpp
+++ b/clang/test/OpenMP/for_firstprivate_messages.cpp
@@ -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};
@@ -288,6 +296,10 @@ int main(int argc, char **argv) {
#pragma omp for firstprivate(i) // expected-error {{firstprivate variable must be shared}}
for (i = 0; i < argc; ++i)
foo();
+#pragma omp parallel
+#pragma omp for firstprivate(B::x) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+ for (i = 0; i < argc; ++i)
+ foo();
return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
}
OpenPOWER on IntegriCloud