diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2018-02-16 21:23:23 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-02-16 21:23:23 +0000 |
| commit | 8e39c3446f137dd89a43529ee893784213743931 (patch) | |
| tree | ec2b46918773af7efb3384018c24e1378d52be2e /clang/test/OpenMP/declare_target_messages.cpp | |
| parent | 5c33bbed583a1e17299f7162118a4bebbe9ce155 (diff) | |
| download | bcm5719-llvm-8e39c3446f137dd89a43529ee893784213743931.tar.gz bcm5719-llvm-8e39c3446f137dd89a43529ee893784213743931.zip | |
[OPENMP] Do not emit messages for templates in declare target
constructs.
The compiler may emit some extra warnings for functions, that are
implicit specialization of the templates, declared in the target region.
llvm-svn: 325391
Diffstat (limited to 'clang/test/OpenMP/declare_target_messages.cpp')
| -rw-r--r-- | clang/test/OpenMP/declare_target_messages.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/OpenMP/declare_target_messages.cpp b/clang/test/OpenMP/declare_target_messages.cpp index 4615dbdae48..3286a29dc41 100644 --- a/clang/test/OpenMP/declare_target_messages.cpp +++ b/clang/test/OpenMP/declare_target_messages.cpp @@ -33,6 +33,33 @@ struct NonT { typedef int sint; +template <typename T> +T bla1() { return 0; } + +#pragma omp declare target +template <typename T> +T bla2() { return 0; } +#pragma omp end declare target + +template<> +float bla2() { return 1.0; } + +#pragma omp declare target +void blub2() { + bla2<float>(); + bla2<int>(); +} +#pragma omp end declare target + +void t2() { +#pragma omp target + { + bla2<float>(); + bla2<long>(); + } +} + + #pragma omp declare target // expected-note {{to match this '#pragma omp declare target'}} #pragma omp threadprivate(a) // expected-note {{defined as threadprivate or thread local}} extern int b; |

