summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorStephane Moore <mog@google.com>2018-12-13 03:35:10 +0000
committerStephane Moore <mog@google.com>2018-12-13 03:35:10 +0000
commit3897b2dca1bc01cbb4d865d86711de3fe2ce9be0 (patch)
treec499bed799eec89bbcc9b72b9e82a2e98ace4e2d /clang/unittests
parent6071e1aa581eff5447ce99e5e599b59ea2ce4a62 (diff)
downloadbcm5719-llvm-3897b2dca1bc01cbb4d865d86711de3fe2ce9be0.tar.gz
bcm5719-llvm-3897b2dca1bc01cbb4d865d86711de3fe2ce9be0.zip
[clang] Add AST matcher for block expressions 🔍
Summary: This change adds a new AST matcher for block expressions. Test Notes: Ran the clang unit tests. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55546 llvm-svn: 349004
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
index e37bcbeec1f..d1f94954322 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -1386,6 +1386,10 @@ TEST(ObjCIvarRefExprMatcher, IvarExpr) {
hasDeclaration(namedDecl(hasName("y"))))));
}
+TEST(BlockExprMatcher, BlockExpr) {
+ EXPECT_TRUE(matchesObjC("void f() { ^{}(); }", blockExpr()));
+}
+
TEST(StatementCountIs, FindsNoStatementsInAnEmptyCompoundStatement) {
EXPECT_TRUE(matches("void f() { }",
compoundStmt(statementCountIs(0))));
OpenPOWER on IntegriCloud