diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-05-09 18:14:57 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-05-09 18:14:57 +0000 |
commit | 41ebe0ce64bfc5ea208fc391b6dabd39bf670cec (patch) | |
tree | 68165d28219aeb3f7e72cd0c432551535546982e /clang/test/OpenMP/task_messages.cpp | |
parent | e406f0eec64f5b6ceb38a2afdd119c41f9905f42 (diff) | |
download | bcm5719-llvm-41ebe0ce64bfc5ea208fc391b6dabd39bf670cec.tar.gz bcm5719-llvm-41ebe0ce64bfc5ea208fc391b6dabd39bf670cec.zip |
[OPENMP]Fix PR41768: check DSA for globals with default(none) clauses.
If the default(none) was specified for the construct, we might miss
diagnostic for the globals without explicitly specified data-sharing
attributes. Patch fixes this problem.
llvm-svn: 360362
Diffstat (limited to 'clang/test/OpenMP/task_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/task_messages.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/test/OpenMP/task_messages.cpp b/clang/test/OpenMP/task_messages.cpp index d490c7f8ea4..92bb14983b8 100644 --- a/clang/test/OpenMP/task_messages.cpp +++ b/clang/test/OpenMP/task_messages.cpp @@ -38,10 +38,10 @@ int foo() { #pragma omp task // expected-note@+1 2 {{predetermined as a firstprivate in a task construct here}} ++s1; -#pragma omp task default(none) +#pragma omp task default(none) // expected-note 2 {{explicit data sharing attribute requested here}} #pragma omp task default(shared) ++a; // expected-error 2 {{variable 'a' must have explicitly specified data sharing attributes}} -#pragma omp task default(none) +#pragma omp task default(none) // expected-note 2 {{explicit data sharing attribute requested here}} #pragma omp task // expected-error@+1 {{calling a private constructor of class 'S'}} ++a; // expected-error 2 {{variable 'a' must have explicitly specified data sharing attributes}} @@ -167,7 +167,7 @@ L1: break; } } -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} goto L2; // expected-error {{use of undeclared label 'L2'}} @@ -184,10 +184,10 @@ L2: for (int n = 0; n < 100; ++n) { } -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp task default(shared) ++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}} -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp task ++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}} #pragma omp task default(shared) @@ -201,10 +201,10 @@ L2: #pragma omp task #pragma omp parallel shared(a, b) ++a, ++b; -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp task default(shared) ++sa; // expected-error {{variable 'sa' must have explicitly specified data sharing attributes}} -#pragma omp task default(none) +#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}} #pragma omp task // expected-error@+1 {{calling a private constructor of class 'S'}} ++sa; // expected-error {{variable 'sa' must have explicitly specified data sharing attributes}} |