diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 | 
| commit | 5e20cdd81c44a443562a09007668ffdf76c455af (patch) | |
| tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /test/OpenMP/task_private_messages.cpp | |
| parent | d5f23b0b7528b5c3caed1ba14f897cc4aaa9e3c3 (diff) | |
Notes
Diffstat (limited to 'test/OpenMP/task_private_messages.cpp')
| -rw-r--r-- | test/OpenMP/task_private_messages.cpp | 21 | 
1 files changed, 17 insertions, 4 deletions
| diff --git a/test/OpenMP/task_private_messages.cpp b/test/OpenMP/task_private_messages.cpp index 9a3bb757681c..c2c1f519d0c1 100644 --- a/test/OpenMP/task_private_messages.cpp +++ b/test/OpenMP/task_private_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() {  } @@ -14,7 +14,7 @@ class S2 {  public:    S2() : a(0) {} -  static float S2s; // expected-note {{static data member is predetermined as shared}} +  static float S2s;  };  const S2 b;  const S2 ba[5]; @@ -45,6 +45,19 @@ public:  int threadvar;  #pragma omp threadprivate(threadvar) // expected-note {{defined as threadprivate or thread local}} +void bar(int n, int b[n]) { +#pragma omp task private(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;       // expected-note {{constant variable is predetermined as shared}}    const int da[5] = {0}; // expected-note {{constant variable is predetermined as shared}} @@ -65,9 +78,9 @@ int main(int argc, char **argv) {  #pragma omp task private(ba)  #pragma omp task private(ca)           // expected-error {{shared variable cannot be private}}  #pragma omp task private(da)           // expected-error {{shared variable cannot be private}} -#pragma omp task private(S2::S2s)      // expected-error {{shared variable cannot be private}} +#pragma omp task private(S2::S2s)  #pragma omp task private(e, g)         // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} -#pragma omp task private(threadvar)    // expected-error {{threadprivate or thread local variable cannot be private}} +#pragma omp task private(threadvar, B::x)    // expected-error 2 {{threadprivate or thread local variable cannot be private}}  #pragma omp task shared(i), private(i) // expected-error {{shared variable cannot be private}} expected-note {{defined as shared}}    foo();  #pragma omp task firstprivate(i) private(i) // expected-error {{firstprivate variable cannot be private}} expected-note {{defined as firstprivate}} | 
