diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-07-26 14:50:05 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-07-26 14:50:05 +0000 |
| commit | 8a8c69808c36510da55a5b5225305bacc229a78a (patch) | |
| tree | c61d153625f44a427fe81c6d9ef182e0bd4ac2bc /clang/test/OpenMP/taskloop_reduction_messages.cpp | |
| parent | 447ef830684bb1a7773b652601d0ac86af6bcdc5 (diff) | |
| download | bcm5719-llvm-8a8c69808c36510da55a5b5225305bacc229a78a.tar.gz bcm5719-llvm-8a8c69808c36510da55a5b5225305bacc229a78a.zip | |
[OPENMP]Add support for analysis of reduction variables.
Summary:
Reduction variables are the variables, for which the private copies
must be created in the OpenMP regions. Then they are initialized with
the predefined values depending on the reduction operation. After exit
from the OpenMP region the original variable is updated using the
reduction value and the value of the original reduction variable.
Reviewers: NoQ
Subscribers: guansong, jdoerfert, caomhin, kkwli0, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65106
llvm-svn: 367116
Diffstat (limited to 'clang/test/OpenMP/taskloop_reduction_messages.cpp')
| -rw-r--r-- | clang/test/OpenMP/taskloop_reduction_messages.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/OpenMP/taskloop_reduction_messages.cpp b/clang/test/OpenMP/taskloop_reduction_messages.cpp index b7a0f2eb0d9..da044ab2c9c 100644 --- a/clang/test/OpenMP/taskloop_reduction_messages.cpp +++ b/clang/test/OpenMP/taskloop_reduction_messages.cpp @@ -16,6 +16,13 @@ extern const omp_allocator_handle_t omp_cgroup_mem_alloc; extern const omp_allocator_handle_t omp_pteam_mem_alloc; extern const omp_allocator_handle_t omp_thread_mem_alloc; +void xxx(int argc) { + int fp; // expected-note {{initialize the variable 'fp' to silence this warning}} +#pragma omp taskloop reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}} + for (int i = 0; i < 10; ++i) + ; +} + void foo() { } |

