summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp')
-rw-r--r--clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp b/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp
index 9011b3f65ec..5483f8f3580 100644
--- a/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp
+++ b/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp
@@ -380,6 +380,13 @@ TEST_F(RegistryTest, VariadicOp) {
EXPECT_FALSE(matches("class Bar{ int Foo; };", D));
EXPECT_TRUE(matches("class OtherBar{ int Foo; };", D));
+
+ D = constructMatcher(
+ "namedDecl", constructMatcher("hasName", std::string("Foo")),
+ constructMatcher("unless", constructMatcher("recordDecl")))
+ .getTypedMatcher<Decl>();
+ EXPECT_TRUE(matches("void Foo(){}", D));
+ EXPECT_TRUE(notMatches("struct Foo {};", D));
}
TEST_F(RegistryTest, Errors) {
OpenPOWER on IntegriCloud