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/for_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/for_reduction_messages.cpp')
| -rw-r--r-- | clang/test/OpenMP/for_reduction_messages.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/OpenMP/for_reduction_messages.cpp b/clang/test/OpenMP/for_reduction_messages.cpp index a082e5843e3..1ba3a604c62 100644 --- a/clang/test/OpenMP/for_reduction_messages.cpp +++ b/clang/test/OpenMP/for_reduction_messages.cpp @@ -7,6 +7,14 @@ // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized extern int omp_default_mem_alloc; +void xxx(int argc) { + int fp; // expected-note {{initialize the variable 'fp' to silence this warning}} +#pragma omp parallel +#pragma omp for reduction(+:fp) // expected-warning {{variable 'fp' is uninitialized when used here}} + for (int i = 0; i < 10; ++i) + ; +} + void foo() { } |

