diff options
Diffstat (limited to 'test/OpenMP/for_private_messages.cpp')
-rw-r--r-- | test/OpenMP/for_private_messages.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/OpenMP/for_private_messages.cpp b/test/OpenMP/for_private_messages.cpp index 45c8683cfa8e..225a1beb99ea 100644 --- a/test/OpenMP/for_private_messages.cpp +++ b/test/OpenMP/for_private_messages.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s +// RUN: %clang_cc1 -verify -fopenmp %s void foo() { } @@ -108,6 +108,21 @@ int foomain(I argc, C **argv) { return 0; } +void bar(S4 a[2]) { +#pragma omp parallel +#pragma omp for private(a) + for (int i = 0; i < 2; ++i) + 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) { S4 e(4); S5 g(5); @@ -149,6 +164,9 @@ int main(int argc, char **argv) { #pragma omp for private(h) // expected-error {{threadprivate or thread local variable cannot be private}} for (int k = 0; k < argc; ++k) ++k; +#pragma omp for private(B::x) // expected-error {{threadprivate or thread local variable cannot be private}} + for (int k = 0; k < argc; ++k) + ++k; #pragma omp for shared(i) // expected-error {{unexpected OpenMP clause 'shared' in directive '#pragma omp for'}} for (int k = 0; k < argc; ++k) ++k; |