summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-07-22 13:51:07 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-07-22 13:51:07 +0000
commit25569296c6d1afe343e895dad00a8ede3abcfaa2 (patch)
treea11bbd9d5f448ff500d5445dbcf70e2527aa43a7 /clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
parent4668ea40722b1082e7a5f8aa0d24055e748836d2 (diff)
downloadbcm5719-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/distribute_parallel_for_firstprivate_messages.cpp')
-rw-r--r--clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp b/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
index d283c29c328..3206c1c71a0 100644
--- a/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
+++ b/clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp
@@ -8,6 +8,14 @@ void foo() {
bool foobool(int argc) {
return argc;
}
+
+void xxx(int argc) {
+ int fp; // expected-note {{initialize the variable 'fp' to silence this warning}}
+#pragma omp distribute parallel for firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}}
+ for (int i = 0; i < 10; ++i)
+ ;
+}
+
extern int omp_default_mem_alloc;
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
OpenPOWER on IntegriCloud