summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorSamuel Benzaquen <sbenza@google.com>2015-12-22 20:06:40 +0000
committerSamuel Benzaquen <sbenza@google.com>2015-12-22 20:06:40 +0000
commitbd3232af03bfbd2d907a78e8d8f814d7cd2204c2 (patch)
treeeec937b928f1d109c3fb7ce8c260360bf506a2dd /clang/unittests
parenta61deb249ba13fbbb80a4927e0c619f54e62ee30 (diff)
downloadbcm5719-llvm-bd3232af03bfbd2d907a78e8d8f814d7cd2204c2.tar.gz
bcm5719-llvm-bd3232af03bfbd2d907a78e8d8f814d7cd2204c2.zip
[ASTMatchers] Add booleanType() matcher.
llvm-svn: 256278
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
index 80f234338a3..cd18df8410b 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -4146,6 +4146,13 @@ TEST(TypeMatching, MatchesTypes) {
EXPECT_TRUE(matches("struct S {};", qualType().bind("loc")));
}
+TEST(TypeMatching, MatchesBool) {
+ EXPECT_TRUE(matches("struct S { bool func(); };",
+ cxxMethodDecl(returns(booleanType()))));
+ EXPECT_TRUE(notMatches("struct S { void func(); };",
+ cxxMethodDecl(returns(booleanType()))));
+}
+
TEST(TypeMatching, MatchesVoid) {
EXPECT_TRUE(matches("struct S { void func(); };",
cxxMethodDecl(returns(voidType()))));
OpenPOWER on IntegriCloud