diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-08-28 14:55:08 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-08-28 14:55:08 +0000 |
commit | 94a170f811de3c076634f4e0d7ec757a84d0d671 (patch) | |
tree | 3f4e8b58ff26e04dca9a474dc5ab44cea899fab7 /clang/test/OpenMP/target_data_messages.c | |
parent | 316bfb0f4848972b6e1b15a18ae5c8de34d65b32 (diff) | |
download | bcm5719-llvm-94a170f811de3c076634f4e0d7ec757a84d0d671.tar.gz bcm5719-llvm-94a170f811de3c076634f4e0d7ec757a84d0d671.zip |
[OPENMP][Analysis] Add analysis of the map clauses.
Summary:
Added basic analysis of map clauses. Only map clauses with to and tofrom
map type must be analyzed since all other map types (alloc, delete, etc.) do not require to use the value of the initial variable, instead they create the new copy of the variable.
Reviewers: NoQ
Subscribers: guansong, cfe-commits, kkwli0, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66668
llvm-svn: 370214
Diffstat (limited to 'clang/test/OpenMP/target_data_messages.c')
-rw-r--r-- | clang/test/OpenMP/target_data_messages.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/OpenMP/target_data_messages.c b/clang/test/OpenMP/target_data_messages.c index 9497ddba026..7dd48f7e507 100644 --- a/clang/test/OpenMP/target_data_messages.c +++ b/clang/test/OpenMP/target_data_messages.c @@ -4,6 +4,13 @@ void foo() { } +void xxx(int argc) { + int map; // expected-note {{initialize the variable 'map' to silence this warning}} +#pragma omp target data map(map) // expected-warning {{variable 'map' is uninitialized when used here}} + for (int i = 0; i < 10; ++i) + ; +} + int main(int argc, char **argv) { int a; #pragma omp target data // expected-error {{expected at least one 'map' or 'use_device_ptr' clause for '#pragma omp target data'}} |