summaryrefslogtreecommitdiffstats
path: root/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp')
-rw-r--r--unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp b/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
index ef385e7f18..7426dd926d 100644
--- a/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ b/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -2158,5 +2158,13 @@ TEST(IsAssignmentOperator, Basic) {
notMatches("void x() { int a; if(a == 0) return; }", BinAsgmtOperator));
}
+TEST(Matcher, isMain) {
+ EXPECT_TRUE(
+ matches("int main() {}", functionDecl(isMain())));
+
+ EXPECT_TRUE(
+ notMatches("int main2() {}", functionDecl(isMain())));
+}
+
} // namespace ast_matchers
} // namespace clang