summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorDave Lee <davelee.com@gmail.com>2017-10-26 15:53:37 +0000
committerDave Lee <davelee.com@gmail.com>2017-10-26 15:53:37 +0000
commit55540a0ce7e0f0fb96f33a8efd9fda91a3fe8868 (patch)
tree5c778685723d4d92abda7014aaf24012f849474f /clang/unittests
parent9ee942f4814dd5a12cc37eb0be9e1734c4f0cfe4 (diff)
downloadbcm5719-llvm-55540a0ce7e0f0fb96f33a8efd9fda91a3fe8868.tar.gz
bcm5719-llvm-55540a0ce7e0f0fb96f33a8efd9fda91a3fe8868.zip
Add objcCategoryImplDecl matcher
Summary: Add `objcCategoryImplDecl` which matches ObjC category definitions (`@implementation`). This matcher complements `objcCategoryDecl` (`@interface`) which was added in D30854. Reviewers: aaron.ballman, malcolm.parsons, alexshap Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D39293 llvm-svn: 316670
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index beb6ed880a0..a24d8d338e7 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
@@ -1590,7 +1590,7 @@ TEST(ObjCMessageExprMatcher, SimpleExprs) {
)));
}
-TEST(ObjCDeclMacher, CoreDecls) {
+TEST(ObjCDeclMatcher, CoreDecls) {
std::string ObjCString =
"@protocol Proto "
"- (void)protoDidThing; "
@@ -1605,6 +1605,9 @@ TEST(ObjCDeclMacher, CoreDecls) {
"{ id _ivar; } "
"- (void)anything {} "
"@end "
+ "@implementation Thing (ABC) "
+ "- (void)abc_doThing {} "
+ "@end "
;
EXPECT_TRUE(matchesObjC(
@@ -1618,6 +1621,9 @@ TEST(ObjCDeclMacher, CoreDecls) {
objcCategoryDecl(hasName("ABC"))));
EXPECT_TRUE(matchesObjC(
ObjCString,
+ objcCategoryImplDecl(hasName("ABC"))));
+ EXPECT_TRUE(matchesObjC(
+ ObjCString,
objcMethodDecl(hasName("protoDidThing"))));
EXPECT_TRUE(matchesObjC(
ObjCString,
OpenPOWER on IntegriCloud