diff options
| author | Stephane Moore <mog@google.com> | 2018-12-13 03:35:10 +0000 |
|---|---|---|
| committer | Stephane Moore <mog@google.com> | 2018-12-13 03:35:10 +0000 |
| commit | 3897b2dca1bc01cbb4d865d86711de3fe2ce9be0 (patch) | |
| tree | c499bed799eec89bbcc9b72b9e82a2e98ace4e2d /clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp | |
| parent | 6071e1aa581eff5447ce99e5e599b59ea2ce4a62 (diff) | |
| download | bcm5719-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/ASTMatchers/ASTMatchersNarrowingTest.cpp')
| -rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp | 4 |
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)))); |

