summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/declare_simd_ast_print.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-09-16 17:06:31 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-09-16 17:06:31 +0000
commita00630785fc7bbc723950543b0d82b6a70bfc797 (patch)
tree6cb70496615e6dc9b83af0da26874c80c1e6024c /clang/test/OpenMP/declare_simd_ast_print.cpp
parent10151f661854e3ee4922662f1d0f62b327cbfa8c (diff)
downloadbcm5719-llvm-a00630785fc7bbc723950543b0d82b6a70bfc797.tar.gz
bcm5719-llvm-a00630785fc7bbc723950543b0d82b6a70bfc797.zip
[OPENMP]Fix parsing/sema for function templates with declare simd.
Need to return original declaration group with FunctionTemplateDecl, not the inner FunctionDecl, to correctly handle parsing of directives with the templates parameters. llvm-svn: 372011
Diffstat (limited to 'clang/test/OpenMP/declare_simd_ast_print.cpp')
-rw-r--r--clang/test/OpenMP/declare_simd_ast_print.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/OpenMP/declare_simd_ast_print.cpp b/clang/test/OpenMP/declare_simd_ast_print.cpp
index c09f8b42e6d..565dc2dfc04 100644
--- a/clang/test/OpenMP/declare_simd_ast_print.cpp
+++ b/clang/test/OpenMP/declare_simd_ast_print.cpp
@@ -21,6 +21,15 @@ void add_1(float *d) __attribute__((cold));
// CHECK-NEXT: void add_1(float *d) __attribute__((cold));
//
+#pragma omp declare simd aligned(hp, hp2:V)
+#pragma omp declare simd aligned(hp, hp2:V)
+template <class C, int V> void h(C *hp, C *hp2, C *hq, C *lin) {
+}
+// CHECK-NEXT: #pragma omp declare simd aligned(hp: V) aligned(hp2: V)
+// CHECK-NEXT: #pragma omp declare simd aligned(hp: V) aligned(hp2: V)
+// CHECK-NEXT: template <class C, int V> void h(C *hp, C *hp2, C *hq, C *lin) {
+// CHECK-NEXT: }
+
#pragma omp declare simd aligned(hp, hp2)
template <class C> void h(C *hp, C *hp2, C *hq, C *lin) {
}
OpenPOWER on IntegriCloud