diff options
author | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /test/OpenMP/parallel_for_lastprivate_messages.cpp | |
parent | 38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff) | |
download | FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz |
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/OpenMP/parallel_for_lastprivate_messages.cpp')
-rw-r--r-- | test/OpenMP/parallel_for_lastprivate_messages.cpp | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/test/OpenMP/parallel_for_lastprivate_messages.cpp b/test/OpenMP/parallel_for_lastprivate_messages.cpp index bd1dd4b..09bed02 100644 --- a/test/OpenMP/parallel_for_lastprivate_messages.cpp +++ b/test/OpenMP/parallel_for_lastprivate_messages.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s +// RUN: %clang_cc1 -verify -fopenmp %s void foo() { } @@ -15,15 +15,17 @@ class S2 { public: S2() : a(0) {} S2(S2 &s2) : a(s2.a) {} - static float S2s; // expected-note {{static data member is predetermined as shared}} + S2 &operator=(const S2 &); + const S2 &operator=(const S2 &) const; + static float S2s; static const float S2sc; }; const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}} const S2 b; const S2 ba[5]; -class S3 { // expected-note 2 {{'S3' declared here}} +class S3 { int a; - S3 &operator=(const S3 &s3); + S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} public: S3() : a(0) {} @@ -32,17 +34,17 @@ public: const S3 c; // expected-note {{global variable is predetermined as shared}} const S3 ca[5]; // expected-note {{global variable is predetermined as shared}} extern const int f; // expected-note {{global variable is predetermined as shared}} -class S4 { // expected-note 3 {{'S4' declared here}} +class S4 { int a; - S4(); + S4(); // expected-note 3 {{implicitly declared private here}} S4(const S4 &s4); public: S4(int v) : a(v) {} }; -class S5 { // expected-note {{'S5' declared here}} +class S5 { int a; - S5() : a(0) {} + S5() : a(0) {} // expected-note {{implicitly declared private here}} public: S5(const S5 &s5) : a(s5.a) {} @@ -62,8 +64,8 @@ S3 h; template <class I, class C> int foomain(int argc, char **argv) { - I e(4); // expected-note {{'e' defined here}} - I g(5); // expected-note {{'g' defined here}} + I e(4); + I g(5); int i; int &j = i; // expected-note {{'j' defined here}} #pragma omp parallel for lastprivate // expected-error {{expected '(' after 'lastprivate'}} @@ -96,7 +98,7 @@ int foomain(int argc, char **argv) { #pragma omp parallel for lastprivate(argv[1]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; -#pragma omp parallel for lastprivate(e, g) // expected-error 2 {{lastprivate variable must have an accessible, unambiguous default constructor}} +#pragma omp parallel for lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}} for (int k = 0; k < argc; ++k) ++k; #pragma omp parallel for lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}} @@ -126,12 +128,20 @@ 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; // expected-note {{constant variable is predetermined as shared}} const int da[5] = {0}; // expected-note {{constant variable is predetermined as shared}} - S4 e(4); // expected-note {{'e' defined here}} - S5 g(5); // expected-note {{'g' defined here}} - S3 m; // expected-note 2 {{'m' defined here}} + S4 e(4); + S5 g(5); + S3 m; S6 n(2); int i; int &j = i; // expected-note {{'j' defined here}} @@ -181,7 +191,7 @@ int main(int argc, char **argv) { #pragma omp parallel for lastprivate(xa) // OK for (i = 0; i < argc; ++i) foo(); -#pragma omp parallel for lastprivate(S2::S2s) // expected-error {{shared variable cannot be lastprivate}} +#pragma omp parallel for lastprivate(S2::S2s) for (i = 0; i < argc; ++i) foo(); #pragma omp parallel for lastprivate(S2::S2sc) // expected-error {{shared variable cannot be lastprivate}} @@ -190,13 +200,13 @@ int main(int argc, char **argv) { #pragma omp parallel for safelen(5) // expected-error {{unexpected OpenMP clause 'safelen' in directive '#pragma omp parallel for'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp parallel for lastprivate(e, g) // expected-error 2 {{lastprivate variable must have an accessible, unambiguous default constructor}} +#pragma omp parallel for lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp parallel for lastprivate(m) // expected-error {{lastprivate variable must have an accessible, unambiguous copy assignment operator}} +#pragma omp parallel for lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp parallel for lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}} +#pragma omp parallel for lastprivate(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be lastprivate}} for (i = 0; i < argc; ++i) foo(); #pragma omp parallel for private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}} @@ -216,7 +226,7 @@ int main(int argc, char **argv) { #pragma omp parallel for lastprivate(j) // expected-error {{arguments of OpenMP clause 'lastprivate' cannot be of reference type}} for (i = 0; i < argc; ++i) foo(); -#pragma omp parallel for firstprivate(m) lastprivate(m) // expected-error {{lastprivate variable must have an accessible, unambiguous copy assignment operator}} +#pragma omp parallel for firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} for (i = 0; i < argc; ++i) foo(); #pragma omp parallel for lastprivate(n) firstprivate(n) // OK |