diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-07-22 13:51:07 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-07-22 13:51:07 +0000 |
| commit | 25569296c6d1afe343e895dad00a8ede3abcfaa2 (patch) | |
| tree | a11bbd9d5f448ff500d5445dbcf70e2527aa43a7 /clang/test/OpenMP/taskloop_firstprivate_messages.cpp | |
| parent | 4668ea40722b1082e7a5f8aa0d24055e748836d2 (diff) | |
| download | bcm5719-llvm-25569296c6d1afe343e895dad00a8ede3abcfaa2.tar.gz bcm5719-llvm-25569296c6d1afe343e895dad00a8ede3abcfaa2.zip | |
[OPENMP]Add support for analysis of firstprivate variables.
Summary:
Firstprivate variables are the variables, for which the private copies
must be created in the OpenMP regions and must be initialized with the
original values. Thus, we must report if the uninitialized variable is
used as firstprivate.
Reviewers: NoQ
Subscribers: guansong, jdoerfert, caomhin, kkwli0, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64765
llvm-svn: 366689
Diffstat (limited to 'clang/test/OpenMP/taskloop_firstprivate_messages.cpp')
| -rw-r--r-- | clang/test/OpenMP/taskloop_firstprivate_messages.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/OpenMP/taskloop_firstprivate_messages.cpp b/clang/test/OpenMP/taskloop_firstprivate_messages.cpp index b5311f5e27f..8617a1f4b4b 100644 --- a/clang/test/OpenMP/taskloop_firstprivate_messages.cpp +++ b/clang/test/OpenMP/taskloop_firstprivate_messages.cpp @@ -19,6 +19,13 @@ bool foobool(int argc) { return argc; } +void xxx(int argc) { + int fp; // expected-note {{initialize the variable 'fp' to silence this warning}} +#pragma omp taskloop firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}} + for (int i = 0; i < 10; ++i) + ; +} + struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}} extern S1 a; class S2 { |

