From 25569296c6d1afe343e895dad00a8ede3abcfaa2 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 22 Jul 2019 13:51:07 +0000 Subject: [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 --- .../test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/test/OpenMP/distribute_parallel_for_firstprivate_messages.cpp') 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'}} -- cgit v1.2.3