diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-07-15 14:46:23 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-07-15 14:46:23 +0000 |
commit | 63d00b19e5c4c92396c8221a10a4c67e2ba09f91 (patch) | |
tree | 08fa3613fab9eece35397df47165c3ae94c06370 /clang/test/OpenMP/target_parallel_if_messages.cpp | |
parent | 8d879c8d95496c0a9049ff80261fbc5754ce56b3 (diff) | |
download | bcm5719-llvm-63d00b19e5c4c92396c8221a10a4c67e2ba09f91.tar.gz bcm5719-llvm-63d00b19e5c4c92396c8221a10a4c67e2ba09f91.zip |
[OPENMP]Add support for analysis of if clauses.
Summary:
Added support for analysis of if clauses in the OpenMP directives to be
able to check for the use of uninitialized variables.
Reviewers: NoQ
Subscribers: guansong, jfb, jdoerfert, caomhin, kkwli0, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64646
llvm-svn: 366068
Diffstat (limited to 'clang/test/OpenMP/target_parallel_if_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/target_parallel_if_messages.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/OpenMP/target_parallel_if_messages.cpp b/clang/test/OpenMP/target_parallel_if_messages.cpp index 460e0c8655f..ac498a7108b 100644 --- a/clang/test/OpenMP/target_parallel_if_messages.cpp +++ b/clang/test/OpenMP/target_parallel_if_messages.cpp @@ -9,6 +9,13 @@ bool foobool(int argc) { return argc; } +void xxx(int argc) { + int cond; // expected-note {{initialize the variable 'cond' to silence this warning}} +#pragma omp target parallel if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}} + for (int i = 0; i < 10; ++i) + ; +} + struct S1; // expected-note {{declared here}} template <class T, class S> // expected-note {{declared here}} |