diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-08-18 06:47:21 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-08-18 06:47:21 +0000 |
commit | bd9fec1eaacb7f0769017aef8f6f6453dd160b7f (patch) | |
tree | 835f6e7bf3f7d0d34ef6536db38a40fc442868a7 /clang/test/OpenMP/task_messages.cpp | |
parent | 3c32c83daa5e7ceda3f5cb7cd3bf4059c197a202 (diff) | |
download | bcm5719-llvm-bd9fec1eaacb7f0769017aef8f6f6453dd160b7f.tar.gz bcm5719-llvm-bd9fec1eaacb7f0769017aef8f6f6453dd160b7f.zip |
[OPENMP 4.1] Allow variables with reference types in private clauses.
OpenMP 4.1 allows to use variables with reference types in all private clauses (private, firstprivate, lastprivate, linear etc.). Patch allows to use such variables and fixes codegen for linear variables with reference types.
llvm-svn: 245268
Diffstat (limited to 'clang/test/OpenMP/task_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/task_messages.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/clang/test/OpenMP/task_messages.cpp b/clang/test/OpenMP/task_messages.cpp index ec67998afdc..64bf8a40f02 100644 --- a/clang/test/OpenMP/task_messages.cpp +++ b/clang/test/OpenMP/task_messages.cpp @@ -6,7 +6,7 @@ void foo() { #pragma omp task // expected-error {{unexpected OpenMP directive '#pragma omp task'}} class S { - S(const S &s) { a = s.a + 12; } // expected-note 6 {{implicitly declared private here}} + S(const S &s) { a = s.a + 12; } // expected-note 10 {{implicitly declared private here}} int a; public: @@ -29,7 +29,7 @@ public: template <class T> int foo() { T a; - T &b = a; // expected-note 4 {{'b' defined here}} + T &b = a; int r; S1 s1; // expected-error@+1 2 {{call to deleted constructor of 'S1'}} @@ -53,16 +53,11 @@ int foo() { #pragma omp task #pragma omp parallel ++a; -// expected-error@+2 {{predetermined as a firstprivate in a task construct variable cannot be of reference type 'int &'}} -// expected-error@+1 {{predetermined as a firstprivate in a task construct variable cannot be of reference type 'S &'}} +// expected-error@+2 {{calling a private constructor of class 'S'}} #pragma omp task - // expected-note@+1 2 {{used here}} ++b; -// expected-error@+2 {{predetermined as a firstprivate in a task construct variable cannot be of reference type 'int &'}} -// expected-error@+1 {{predetermined as a firstprivate in a task construct variable cannot be of reference type 'S &'}} #pragma omp task -// expected-error@+2 {{calling a private constructor of class 'S'}} -// expected-note@+1 2 {{used here}} +// expected-error@+1 2 {{calling a private constructor of class 'S'}} #pragma omp parallel shared(a, b) ++a, ++b; // expected-note@+1 3 {{defined as reduction}} @@ -120,9 +115,9 @@ int foo() { int main(int argc, char **argv) { int a; - int &b = a; // expected-note 2 {{'b' defined here}} + int &b = a; S sa; - S &sb = sa; // expected-note 2 {{'sb' defined here}} + S &sb = sa; int r; #pragma omp task { // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}} foo(); @@ -192,13 +187,9 @@ L2: #pragma omp task #pragma omp parallel ++a; -// expected-error@+1 {{predetermined as a firstprivate in a task construct variable cannot be of reference type 'int &'}} #pragma omp task - // expected-note@+1 {{used here}} ++b; -// expected-error@+1 {{predetermined as a firstprivate in a task construct variable cannot be of reference type 'int &'}} #pragma omp task -// expected-note@+1 {{used here}} #pragma omp parallel shared(a, b) ++a, ++b; #pragma omp task default(none) @@ -218,14 +209,11 @@ L2: #pragma omp task #pragma omp parallel ++sa; -// expected-error@+1 {{predetermined as a firstprivate in a task construct variable cannot be of reference type 'S &'}} +// expected-error@+2 {{calling a private constructor of class 'S'}} #pragma omp task - // expected-note@+1 {{used here}} ++sb; -// expected-error@+1 {{predetermined as a firstprivate in a task construct variable cannot be of reference type 'S &'}} +// expected-error@+2 2 {{calling a private constructor of class 'S'}} #pragma omp task -// expected-error@+2 {{calling a private constructor of class 'S'}} -// expected-note@+1 {{used here}} #pragma omp parallel shared(sa, sb) ++sa, ++sb; // expected-note@+1 2 {{defined as reduction}} |