diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-05-06 17:49:22 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-05-06 17:49:22 +0000 |
commit | cf9e7a282b74cd12cd266ab11291a58fdc871976 (patch) | |
tree | bf05b4eedbe1d76d98fe7ef08e485050fd155096 /clang/test/OpenMP/parallel_messages.cpp | |
parent | 865a39d328c2fa0ce251447bf2d6005dbbfec595 (diff) | |
download | bcm5719-llvm-cf9e7a282b74cd12cd266ab11291a58fdc871976.tar.gz bcm5719-llvm-cf9e7a282b74cd12cd266ab11291a58fdc871976.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: 360061
Diffstat (limited to 'clang/test/OpenMP/parallel_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/parallel_messages.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/test/OpenMP/parallel_messages.cpp b/clang/test/OpenMP/parallel_messages.cpp index 8b0c0353c20..49fc2305ff3 100644 --- a/clang/test/OpenMP/parallel_messages.cpp +++ b/clang/test/OpenMP/parallel_messages.cpp @@ -7,6 +7,7 @@ void foo() { #pragma omp parallel // expected-error {{unexpected OpenMP directive '#pragma omp parallel'}} +int a; struct S; S& bar(); int main(int argc, char **argv) { @@ -54,8 +55,11 @@ int main(int argc, char **argv) { break; } } - #pragma omp parallel default(none) - ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} +#pragma omp parallel default(none) // expected-note 2 {{explicit data sharing attribute requested here}} + { + ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} + ++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}} + } goto L2; // expected-error {{use of undeclared label 'L2'}} #pragma omp parallel |