[clang] 35efef5 - Add missing test

Stephen Kelly via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 5 13:57:00 PST 2020


Author: Stephen Kelly
Date: 2020-01-05T21:55:52Z
New Revision: 35efef5351e3b3a4e50bcd862407ef7edc0b2166

URL: https://github.com/llvm/llvm-project/commit/35efef5351e3b3a4e50bcd862407ef7edc0b2166
DIFF: https://github.com/llvm/llvm-project/commit/35efef5351e3b3a4e50bcd862407ef7edc0b2166.diff

LOG: Add missing test

Added: 
    

Modified: 
    clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
index 327ed979962f..a127a666ea67 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>


        


More information about the cfe-commits mailing list