[ASTImporter] Add test for PackExpansionExpr
authorRaphael Isemann <teemperor@gmail.com>
Fri, 24 Aug 2018 18:01:56 +0000 (18:01 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Fri, 24 Aug 2018 18:01:56 +0000 (18:01 +0000)
Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: martong, cfe-commits

Differential Revision: https://reviews.llvm.org/D51142

llvm-svn: 340627

clang/test/Import/pack-expansion-expr/Inputs/F.cpp [new file with mode: 0644]
clang/test/Import/pack-expansion-expr/test.cpp [new file with mode: 0644]

diff --git a/clang/test/Import/pack-expansion-expr/Inputs/F.cpp b/clang/test/Import/pack-expansion-expr/Inputs/F.cpp
new file mode 100644 (file)
index 0000000..528451c
--- /dev/null
@@ -0,0 +1,11 @@
+template <typename... T>
+void sink(T... a);
+
+template <typename... T>
+void packfuncT(T... a) {
+  sink(a...);
+}
+
+void f() {
+  packfuncT(1, 2, 3);
+}
diff --git a/clang/test/Import/pack-expansion-expr/test.cpp b/clang/test/Import/pack-expansion-expr/test.cpp
new file mode 100644 (file)
index 0000000..3e9867b
--- /dev/null
@@ -0,0 +1,12 @@
+// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s
+
+// CHECK: PackExpansionExpr
+// CHECK-SAME: '<dependent type>'
+// CHECK-NEXT: DeclRefExpr
+// CHECK-SAME: 'T...'
+// CHECK-SAME: ParmVar
+// CHECK-SAME: 'a'
+
+void expr() {
+  f();
+}