diff options
| author | Ilya Biryukov <ibiryukov@google.com> | 2019-11-21 11:32:17 +0100 |
|---|---|---|
| committer | Ilya Biryukov <ibiryukov@google.com> | 2019-11-21 11:56:09 +0100 |
| commit | aa981c1802d7353c777e399f2568e5a0e12dea21 (patch) | |
| tree | 988917b64870affe5a5259fa9232419f1fac0ece /llvm/unittests/Support/SpecialCaseListTest.cpp | |
| parent | f65cfff605f2fd802fc337c6152474e3f3d22a1c (diff) | |
| download | bcm5719-llvm-aa981c1802d7353c777e399f2568e5a0e12dea21.tar.gz bcm5719-llvm-aa981c1802d7353c777e399f2568e5a0e12dea21.zip | |
Reland 9f3fdb0d7fab: [Driver] Use VFS to check if sanitizer blacklists exist
With updates to various LLVM tools that use SpecialCastList.
It was tempting to use RealFileSystem as the default, but that makes it
too easy to accidentally forget passing VFS in clang code.
Diffstat (limited to 'llvm/unittests/Support/SpecialCaseListTest.cpp')
| -rw-r--r-- | llvm/unittests/Support/SpecialCaseListTest.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/unittests/Support/SpecialCaseListTest.cpp b/llvm/unittests/Support/SpecialCaseListTest.cpp index 2245588d97c..de1f058b67f 100644 --- a/llvm/unittests/Support/SpecialCaseListTest.cpp +++ b/llvm/unittests/Support/SpecialCaseListTest.cpp @@ -9,6 +9,7 @@ #include "llvm/Support/SpecialCaseList.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/VirtualFileSystem.h" #include "gtest/gtest.h" using namespace llvm; @@ -161,7 +162,8 @@ TEST_F(SpecialCaseListTest, InvalidSpecialCaseList) { EXPECT_EQ("malformed regex in line 2: 'fun(a': parentheses not balanced", Error); std::vector<std::string> Files(1, "unexisting"); - EXPECT_EQ(nullptr, SpecialCaseList::create(Files, Error)); + EXPECT_EQ(nullptr, + SpecialCaseList::create(Files, *vfs::getRealFileSystem(), Error)); EXPECT_EQ(0U, Error.find("can't open file 'unexisting':")); } @@ -177,7 +179,7 @@ TEST_F(SpecialCaseListTest, MultipleBlacklists) { "src:ban=init\n")); Files.push_back(makeSpecialCaseListFile("src:baz\n" "src:*fog*\n")); - auto SCL = SpecialCaseList::createOrDie(Files); + auto SCL = SpecialCaseList::createOrDie(Files, *vfs::getRealFileSystem()); EXPECT_TRUE(SCL->inSection("", "src", "bar")); EXPECT_TRUE(SCL->inSection("", "src", "baz")); EXPECT_FALSE(SCL->inSection("", "src", "ban")); |

