summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/parallel_for_firstprivate_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
commit6ddfe1a6afd4485b1858b32555a80b4ae5ce54ef (patch)
treef575b3477252d1b28d4b77fd5129b0590aac1ae5 /clang/test/OpenMP/parallel_for_firstprivate_messages.cpp
parent2cc44f50a5644e3ae43a6b0158315981ba87212f (diff)
downloadbcm5719-llvm-6ddfe1a6afd4485b1858b32555a80b4ae5ce54ef.tar.gz
bcm5719-llvm-6ddfe1a6afd4485b1858b32555a80b4ae5ce54ef.zip
[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. llvm-svn: 235096
Diffstat (limited to 'clang/test/OpenMP/parallel_for_firstprivate_messages.cpp')
-rw-r--r--clang/test/OpenMP/parallel_for_firstprivate_messages.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/OpenMP/parallel_for_firstprivate_messages.cpp b/clang/test/OpenMP/parallel_for_firstprivate_messages.cpp
index b4958733dec..37239bc2057 100644
--- a/clang/test/OpenMP/parallel_for_firstprivate_messages.cpp
+++ b/clang/test/OpenMP/parallel_for_firstprivate_messages.cpp
@@ -137,6 +137,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;
const int da[5] = {0};
@@ -207,7 +215,7 @@ int main(int argc, char **argv) {
#pragma omp parallel for firstprivate(m) // OK
for (i = 0; i < argc; ++i)
foo();
-#pragma omp parallel for firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+#pragma omp parallel for firstprivate(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be firstprivate}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel for private(xa), firstprivate(xa) // expected-error {{private variable cannot be firstprivate}} expected-note {{defined as private}}
OpenPOWER on IntegriCloud