summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-11-24 17:22:32 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-11-24 17:22:32 +0000
commit54891e047f5b2b0cbe06b6ea0e2deb5c86bb692c (patch)
treec83bdd930b59a30eb902acbd4ca80d59e9f6711b /clang/unittests/ASTMatchers/ASTMatchersTest.cpp
parent098256c5e6c044055e3c90bbc6518d0672d5115a (diff)
downloadbcm5719-llvm-54891e047f5b2b0cbe06b6ea0e2deb5c86bb692c.tar.gz
bcm5719-llvm-54891e047f5b2b0cbe06b6ea0e2deb5c86bb692c.zip
Unbreaking the MSVC 2012 build; however, these tests still fail on Windows.
llvm-svn: 222664
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTest.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
index dcca04fa97c..ba66a2da9ef 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -4634,36 +4634,43 @@ TEST(Matcher, IsExpansionInMainFileMatcher) {
EXPECT_TRUE(matches("class X {};",
recordDecl(hasName("X"), isExpansionInMainFile())));
EXPECT_TRUE(notMatches("", recordDecl(isExpansionInMainFile())));
+ FileContentMappings M;
+ M.push_back(std::make_pair("/other", "class X {};"));
EXPECT_TRUE(matchesConditionally("#include <other>\n",
recordDecl(isExpansionInMainFile()), false,
- "-isystem/", {{"/other", "class X {};"}}));
+ "-isystem/", M));
}
TEST(Matcher, IsExpansionInSystemHeader) {
+ FileContentMappings M;
+ M.push_back(std::make_pair("/other", "class X {};"));
EXPECT_TRUE(matchesConditionally(
"#include \"other\"\n", recordDecl(isExpansionInSystemHeader()), true,
- "-isystem/", {{"/other", "class X {};"}}));
+ "-isystem/", M));
EXPECT_TRUE(matchesConditionally("#include \"other\"\n",
recordDecl(isExpansionInSystemHeader()),
- false, "-I/", {{"/other", "class X {};"}}));
+ false, "-I/", M));
EXPECT_TRUE(notMatches("class X {};",
recordDecl(isExpansionInSystemHeader())));
EXPECT_TRUE(notMatches("", recordDecl(isExpansionInSystemHeader())));
}
TEST(Matcher, IsExpansionInFileMatching) {
+ FileContentMappings M;
+ M.push_back(std::make_pair("/foo", "class A {};"));
+ M.push_back(std::make_pair("/bar", "class B {};"));
EXPECT_TRUE(matchesConditionally(
"#include <foo>\n"
"#include <bar>\n"
"class X {};",
recordDecl(isExpansionInFileMatching("b.*"), hasName("B")), true,
- "-isystem/", {{"/foo", "class A {};"}, {"/bar", "class B {};"}}));
+ "-isystem/", M));
EXPECT_TRUE(matchesConditionally(
"#include <foo>\n"
"#include <bar>\n"
"class X {};",
recordDecl(isExpansionInFileMatching("f.*"), hasName("X")), false,
- "-isystem/", {{"/foo", "class A {};"}, {"/bar", "class B {};"}}));
+ "-isystem/", M));
}
} // end namespace ast_matchers
OpenPOWER on IntegriCloud