diff options
Diffstat (limited to 'unittests/AST/DeclPrinterTest.cpp')
-rw-r--r-- | unittests/AST/DeclPrinterTest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/unittests/AST/DeclPrinterTest.cpp b/unittests/AST/DeclPrinterTest.cpp index 070b4daabb8f5..d8cb97709229b 100644 --- a/unittests/AST/DeclPrinterTest.cpp +++ b/unittests/AST/DeclPrinterTest.cpp @@ -157,6 +157,17 @@ public: "input.cc"); } +::testing::AssertionResult +PrintedDeclCXX1ZMatches(StringRef Code, const DeclarationMatcher &NodeMatch, + StringRef ExpectedPrinted) { + std::vector<std::string> Args(1, "-std=c++1z"); + return PrintedDeclMatches(Code, + Args, + NodeMatch, + ExpectedPrinted, + "input.cc"); +} + ::testing::AssertionResult PrintedDeclObjCMatches( StringRef Code, const DeclarationMatcher &NodeMatch, @@ -1264,6 +1275,13 @@ TEST(DeclPrinter, TestTemplateArgumentList15) { // Should be: with semicolon } +TEST(DeclPrinter, TestStaticAssert1) { + ASSERT_TRUE(PrintedDeclCXX1ZMatches( + "static_assert(true);", + staticAssertDecl().bind("id"), + "static_assert(true)")); +} + TEST(DeclPrinter, TestObjCMethod1) { ASSERT_TRUE(PrintedDeclObjCMatches( "__attribute__((objc_root_class)) @interface X\n" |