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 | 807929a2152ff966de91adacc8b0d4efcc0e71aa (patch) | |
tree | 0029b4214f43171aba69a32fe6f400e795ccf608 /test/OpenMP/target_firstprivate_messages.cpp | |
parent | 69147b7c62a3f8eb2f8f3223da453b31e7bb650d (diff) | |
download | clang-807929a2152ff966de91adacc8b0d4efcc0e71aa.tar.gz |
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366689 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/target_firstprivate_messages.cpp')
-rw-r--r-- | test/OpenMP/target_firstprivate_messages.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/OpenMP/target_firstprivate_messages.cpp b/test/OpenMP/target_firstprivate_messages.cpp index d96516aebe..2b4bf83232 100644 --- a/test/OpenMP/target_firstprivate_messages.cpp +++ b/test/OpenMP/target_firstprivate_messages.cpp @@ -2,6 +2,13 @@ // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized +void xxx(int argc) { + int fp, fp1; // expected-note {{initialize the variable 'fp' to silence this warning}} expected-note {{initialize the variable 'fp1' to silence this warning}} +#pragma omp target firstprivate(fp) // expected-warning {{variable 'fp' is uninitialized when used here}} + for (int i = 0; i < 10; ++i) + ++fp1; // expected-warning {{variable 'fp1' is uninitialized when used here}} +} + typedef void **omp_allocator_handle_t; extern const omp_allocator_handle_t omp_default_mem_alloc; extern const omp_allocator_handle_t omp_large_cap_mem_alloc; |