From 340c0f6776a0c3e7131c904ec66dbeabd76a90e4 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Fri, 24 Aug 2012 00:26:25 +0000 Subject: DeclPrinter tests: add two more tests. llvm-svn: 162511 --- clang/unittests/AST/DeclPrinterTest.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'clang/unittests/AST/DeclPrinterTest.cpp') diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp index 268d48e50fa..b26ed93ddf8 100644 --- a/clang/unittests/AST/DeclPrinterTest.cpp +++ b/clang/unittests/AST/DeclPrinterTest.cpp @@ -498,6 +498,29 @@ TEST(DeclPrinter, TestCXXConstructorDecl9) { // WRONG; Should be: "A() = delete;" } +TEST(DeclPrinter, TestCXXConstructorDecl10) { + ASSERT_TRUE(PrintedDeclCXX11Matches( + "template" + "struct A {" + " A(const A &a);" + "};", + constructor(ofClass(hasName("A"))).bind("id"), + "")); + // WRONG; Should be: "A(const A &a);" +} + +TEST(DeclPrinter, TestCXXConstructorDecl11) { + ASSERT_TRUE(PrintedDeclCXX11Matches( + "template" + "struct A : public T... {" + " A(T&&... ts) : T(ts)... {}" + "};", + constructor(ofClass(hasName("A"))).bind("id"), + "A(T &&ts...) : T(ts)")); + // Should be: "A(T&&... ts) : T(ts)..." +} + + TEST(DeclPrinter, TestCXXDestructorDecl1) { ASSERT_TRUE(PrintedDeclMatches( "struct A {" -- cgit v1.2.3