diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-12-20 02:20:09 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-12-20 02:20:09 +0000 |
commit | 4419449391a16f39058f637658ebe10106bd1c67 (patch) | |
tree | 68d8f0d4a770331d5217981559fe7208834fc95e /clang/unittests/AST/DeclPrinterTest.cpp | |
parent | 90ff6078946e4d9e655fad69e50831ed2e0256a0 (diff) | |
download | bcm5719-llvm-4419449391a16f39058f637658ebe10106bd1c67.tar.gz bcm5719-llvm-4419449391a16f39058f637658ebe10106bd1c67.zip |
Provide couple of DeclPrint tests for my last patch.
llvm-svn: 170635
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 844b9a49e13..44fa74216b5 100644 --- a/clang/unittests/AST/DeclPrinterTest.cpp +++ b/clang/unittests/AST/DeclPrinterTest.cpp @@ -1237,3 +1237,21 @@ TEST(DeclPrinter, TestObjCMethod1) { "- (int) A:(id)anObject inRange:(long)range")); } +TEST(DeclPrinter, TestObjCProtocol1) { + ASSERT_TRUE(PrintedDeclObjCMatches( + "@protocol P1, P2;", + namedDecl(hasName("P1")).bind("id"), + "@protocol P1;\n")); + ASSERT_TRUE(PrintedDeclObjCMatches( + "@protocol P1, P2;", + namedDecl(hasName("P2")).bind("id"), + "@protocol P2;\n")); +} + +TEST(DeclPrinter, TestObjCProtocol2) { + ASSERT_TRUE(PrintedDeclObjCMatches( + "@protocol P2 @end" + "@protocol P1<P2> @end", + namedDecl(hasName("P1")).bind("id"), + "@protocol P1<P2>\n@end")); +} |