diff options
author | Samuel Benzaquen <sbenza@google.com> | 2015-12-22 20:06:40 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2015-12-22 20:06:40 +0000 |
commit | bd3232af03bfbd2d907a78e8d8f814d7cd2204c2 (patch) | |
tree | eec937b928f1d109c3fb7ce8c260360bf506a2dd /clang/unittests | |
parent | a61deb249ba13fbbb80a4927e0c619f54e62ee30 (diff) | |
download | bcm5719-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.cpp | 7 |
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())))); |