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/teams_distribute_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/teams_distribute_firstprivate_messages.cpp')
| -rw-r--r-- | clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp b/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp index 63237e12c96..4a16ed93d68 100644 --- a/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp +++ b/clang/test/OpenMP/teams_distribute_firstprivate_messages.cpp @@ -10,6 +10,14 @@ bool foobool(int argc) { return argc; } +void xxx(int argc) { + int fp; // expected-note {{initialize the variable 'fp' to silence this warning}} +#pragma omp target +#pragma omp teams distribute firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}} + for (int i = 0; i < 10; ++i) + ; +} + struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}} extern S1 a; class S2 { |

