summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
diff options
context:
space:
mode:
authorEdwin Vane <edwin.vane@intel.com>2013-02-12 13:55:40 +0000
committerEdwin Vane <edwin.vane@intel.com>2013-02-12 13:55:40 +0000
commite9dd3608eaf14aa90bc3768ec2fd3f560727cfcf (patch)
tree5977457d1f162a9d5e800e9dda2e4a455644f96f /clang/unittests/ASTMatchers/ASTMatchersTest.cpp
parent584248cf3cebcaf9abefee46fdd348eb17911a1f (diff)
downloadbcm5719-llvm-e9dd3608eaf14aa90bc3768ec2fd3f560727cfcf.tar.gz
bcm5719-llvm-e9dd3608eaf14aa90bc3768ec2fd3f560727cfcf.zip
Adding more overloads for allOf matcher
Adding overloads of allOf accepting 4 and 5 arguments. Reviewer: klimek llvm-svn: 174967
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTest.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
index 618ac6ec51e..129f90f2dc1 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -351,7 +351,9 @@ TEST(ClassTemplate, DoesNotMatchClassTemplatePartialSpecialization) {
TEST(AllOf, AllOverloadsWork) {
const char Program[] =
- "struct T { }; int f(int, T*); void g(int x) { T t; f(x, &t); }";
+ "struct T { };"
+ "int f(int, T*, int, int);"
+ "void g(int x) { T t; f(x, &t, 3, 4); }";
EXPECT_TRUE(matches(Program,
callExpr(allOf(callee(functionDecl(hasName("f"))),
hasArgument(0, declRefExpr(to(varDecl())))))));
@@ -360,6 +362,19 @@ TEST(AllOf, AllOverloadsWork) {
hasArgument(0, declRefExpr(to(varDecl()))),
hasArgument(1, hasType(pointsTo(
recordDecl(hasName("T")))))))));
+ EXPECT_TRUE(matches(Program,
+ callExpr(allOf(callee(functionDecl(hasName("f"))),
+ hasArgument(0, declRefExpr(to(varDecl()))),
+ hasArgument(1, hasType(pointsTo(
+ recordDecl(hasName("T"))))),
+ hasArgument(2, integerLiteral(equals(3)))))));
+ EXPECT_TRUE(matches(Program,
+ callExpr(allOf(callee(functionDecl(hasName("f"))),
+ hasArgument(0, declRefExpr(to(varDecl()))),
+ hasArgument(1, hasType(pointsTo(
+ recordDecl(hasName("T"))))),
+ hasArgument(2, integerLiteral(equals(3))),
+ hasArgument(3, integerLiteral(equals(4)))))));
}
TEST(DeclarationMatcher, MatchAnyOf) {
OpenPOWER on IntegriCloud