summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/parallel_for_lastprivate_messages.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-04-16 13:49:42 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-04-16 13:49:42 +0000
commit680e545622bef4ce7d220fd88541f09ee184c6a2 (patch)
tree3caf8a5ed07a6db419193e83439a4a9ea80ab944 /test/OpenMP/parallel_for_lastprivate_messages.cpp
parente1a7262bc4fc841b95ee6fb45c1bb0da5cc3f2c1 (diff)
[OPENMP] Fix for checking of data-sharing attributes for canonical var decls only.
Currently checks for active data-sharing attributes for variables are performed for found var decls. Instead these checks must be performed for canonical decls of these variables to avoid possible troubles with with the differently qualified re-declarations of the same variable, for example: namespace A { int x; } namespace B { using A::x; } Both A::x and B::x actually reference the same object A::x and this fact must be taken into account during data-sharing attributes analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/parallel_for_lastprivate_messages.cpp')
-rw-r--r--test/OpenMP/parallel_for_lastprivate_messages.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/OpenMP/parallel_for_lastprivate_messages.cpp b/test/OpenMP/parallel_for_lastprivate_messages.cpp
index 86bf9a80b4..6f0945a860 100644
--- a/test/OpenMP/parallel_for_lastprivate_messages.cpp
+++ b/test/OpenMP/parallel_for_lastprivate_messages.cpp
@@ -128,6 +128,14 @@ 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}}
@@ -198,7 +206,7 @@ int main(int argc, char **argv) {
#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}}