diff options
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp')
| -rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp index 82c5139a78f..108fd435cef 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp @@ -842,6 +842,12 @@ TEST(IsExternC, MatchesExternCFunctionDeclarations) { EXPECT_TRUE(notMatches("void f() {}", functionDecl(isExternC()))); } +TEST(IsExternC, MatchesExternCVariableDeclarations) { + EXPECT_TRUE(matches("extern \"C\" int i;", varDecl(isExternC()))); + EXPECT_TRUE(matches("extern \"C\" { int i; }", varDecl(isExternC()))); + EXPECT_TRUE(notMatches("int i;", varDecl(isExternC()))); +} + TEST(IsDefaulted, MatchesDefaultedFunctionDeclarations) { EXPECT_TRUE(notMatches("class A { ~A(); };", functionDecl(hasName("~A"), isDefaulted()))); |

