summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
index 327ed979962..a127a666ea6 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
@@ -1698,6 +1698,18 @@ void bar()
VarDeclCode,
functionDecl(hasName("foo"), traverse(ast_type_traits::TK_AsIs,
hasDescendant(floatLiteral())))));
+
+
+ EXPECT_TRUE(
+ matches(R"cpp(
+void foo()
+{
+ int i = (3);
+}
+)cpp",
+ traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
+ varDecl(hasInitializer(integerLiteral(equals(3)))))));
+
}
template <typename MatcherT>
OpenPOWER on IntegriCloud