diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-12-01 17:40:15 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-12-01 17:40:15 +0000 |
commit | b358f9922a65a9f64b834754a95a50fcb1fb068a (patch) | |
tree | b314082b31f56f4292e9421c0f1dc8ce40e0fd09 /clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp | |
parent | 8d5e469c3299b32aa1f0759b0af44694aab88591 (diff) | |
download | bcm5719-llvm-b358f9922a65a9f64b834754a95a50fcb1fb068a.tar.gz bcm5719-llvm-b358f9922a65a9f64b834754a95a50fcb1fb068a.zip |
[OPENMP] Do not allow variables to be first|last-privates in
distribute directives.
OpenMP standard does not allow to mark the variables as firstprivate and lastprivate at the same time in distribute-based directives. Patch fixes this problem.
llvm-svn: 319560
Diffstat (limited to 'clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp b/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp index a8914350bf5..82ce15e5504 100644 --- a/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp +++ b/clang/test/OpenMP/distribute_simd_lastprivate_messages.cpp @@ -25,7 +25,7 @@ const S2 b; const S2 ba[5]; class S3 { int a; - S3 &operator=(const S3 &s3); // expected-note 2 {{implicitly declared private here}} + S3 &operator=(const S3 &s3); // expected-note {{implicitly declared private here}} public: S3() : a(0) {} @@ -52,7 +52,7 @@ public: }; class S6 { int a; - S6() : a(0) {} + S6() : a(0) {} // expected-note {{implicitly declared private here}} public: S6(const S6 &s6) : a(s6.a) {} @@ -313,14 +313,16 @@ int main(int argc, char **argv) { #pragma omp distribute simd lastprivate(j) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{firstprivate variable cannot be lastprivate}} expected-note@+3 {{defined as firstprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute simd firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}} +#pragma omp distribute simd firstprivate(m) lastprivate(m) for (i = 0; i < argc; ++i) foo(); +// expected-error@+3 {{lastprivate variable cannot be firstprivate}} expected-note@+3 {{defined as lastprivate}} #pragma omp target #pragma omp teams -#pragma omp distribute simd lastprivate(n) firstprivate(n) // OK +#pragma omp distribute simd lastprivate(n) firstprivate(n) // expected-error {{calling a private constructor of class 'S6'}} for (i = 0; i < argc; ++i) foo(); static int si; |