summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/task_firstprivate_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/OpenMP/task_firstprivate_messages.cpp')
-rw-r--r--test/OpenMP/task_firstprivate_messages.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/OpenMP/task_firstprivate_messages.cpp b/test/OpenMP/task_firstprivate_messages.cpp
index 6c5ccfc..0126d47 100644
--- a/test/OpenMP/task_firstprivate_messages.cpp
+++ b/test/OpenMP/task_firstprivate_messages.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
void foo() {
}
@@ -51,6 +51,19 @@ public:
S3 h;
#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
+void bar(int n, int b[n]) {
+#pragma omp task firstprivate(b)
+ foo();
+}
+
+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};
@@ -74,7 +87,7 @@ int main(int argc, char **argv) {
#pragma omp task firstprivate(S2::S2s)
#pragma omp task firstprivate(S2::S2sc)
#pragma omp task firstprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}} expected-error 2 {{calling a private constructor of class 'S5'}}
-#pragma omp task firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+#pragma omp task firstprivate(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be firstprivate}}
#pragma omp task private(i), firstprivate(i) // expected-error {{private variable cannot be firstprivate}} expected-note{{defined as private}}
foo();
#pragma omp task shared(i)
OpenPOWER on IntegriCloud