summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST/DeclPrinterTest.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-12-20 02:20:09 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-12-20 02:20:09 +0000
commit4419449391a16f39058f637658ebe10106bd1c67 (patch)
tree68d8f0d4a770331d5217981559fe7208834fc95e /clang/unittests/AST/DeclPrinterTest.cpp
parent90ff6078946e4d9e655fad69e50831ed2e0256a0 (diff)
downloadbcm5719-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.cpp18
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"));
+}
OpenPOWER on IntegriCloud