diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-06-05 22:40:53 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-06-05 22:40:53 +0000 |
commit | 8423df927eb6b24e8821d557c1a26c4cd0f44fcf (patch) | |
tree | 7b1e83b3f7c9176bd55444210b78c8d72ef20cb3 /clang/unittests/AST/DeclPrinterTest.cpp | |
parent | b41e76bb0bc6aac90e1755477936b216857b05d6 (diff) | |
download | bcm5719-llvm-8423df927eb6b24e8821d557c1a26c4cd0f44fcf.tar.gz bcm5719-llvm-8423df927eb6b24e8821d557c1a26c4cd0f44fcf.zip |
Move a test from static-assert.cpp to DeclPrinterTest
It's better not to rely on the diagnostics engine to pretty print the
argument to decltype. Instead, exercise the functionality in
DeclPrinterTest.
llvm-svn: 239197
Diffstat (limited to 'clang/unittests/AST/DeclPrinterTest.cpp')
-rw-r--r-- | clang/unittests/AST/DeclPrinterTest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp index 070b4daabb8..d8cb9770922 100644 --- a/clang/unittests/AST/DeclPrinterTest.cpp +++ b/clang/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" |