summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2018-07-11 18:43:07 +0000
committerEric Liu <ioeric@google.com>2018-07-11 18:43:07 +0000
commitb71e6f412ff5bd0bd2c8b69ad47072dbe80a7771 (patch)
tree58e8a83105e0360c87554618cd3076f3fd4bfbbb /clang/unittests
parentedf338856cc6e542e515d7537090ebbbccbdce9f (diff)
downloadbcm5719-llvm-b71e6f412ff5bd0bd2c8b69ad47072dbe80a7771.tar.gz
bcm5719-llvm-b71e6f412ff5bd0bd2c8b69ad47072dbe80a7771.zip
Revert "[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name"
This reverts commit r336807. This breaks users of ClangTool::mapVirtualFile. Will try to investigate a fix. See also the discussion on https://reviews.llvm.org/D48903 llvm-svn: 336831
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Basic/VirtualFileSystemTest.cpp33
-rw-r--r--clang/unittests/Driver/ToolChainTest.cpp2
2 files changed, 2 insertions, 33 deletions
diff --git a/clang/unittests/Basic/VirtualFileSystemTest.cpp b/clang/unittests/Basic/VirtualFileSystemTest.cpp
index 54c355d9483..c795be07acf 100644
--- a/clang/unittests/Basic/VirtualFileSystemTest.cpp
+++ b/clang/unittests/Basic/VirtualFileSystemTest.cpp
@@ -794,7 +794,7 @@ TEST_F(InMemoryFileSystemTest, WorkingDirectory) {
auto Stat = FS.status("/b/c");
ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
- ASSERT_EQ("/b/c", Stat->getName());
+ ASSERT_EQ("c", Stat->getName());
ASSERT_EQ("/b", *FS.getCurrentWorkingDirectory());
Stat = FS.status("c");
@@ -919,37 +919,6 @@ TEST_F(InMemoryFileSystemTest, AddDirectoryThenAddChild) {
ASSERT_TRUE(Stat->isRegularFile());
}
-// Test that the name returned by status() is in the same form as the path that
-// was requested (to match the behavior of RealFileSystem).
-TEST_F(InMemoryFileSystemTest, StatusName) {
- NormalizedFS.addFile("/a/b/c", 0, MemoryBuffer::getMemBuffer("abc"),
- /*User=*/None,
- /*Group=*/None, sys::fs::file_type::regular_file);
- NormalizedFS.setCurrentWorkingDirectory("/a/b");
-
- // Access using InMemoryFileSystem::status.
- auto Stat = NormalizedFS.status("../b/c");
- ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n"
- << NormalizedFS.toString();
- ASSERT_TRUE(Stat->isRegularFile());
- ASSERT_EQ("../b/c", Stat->getName());
-
- // Access using InMemoryFileAdaptor::status.
- auto File = NormalizedFS.openFileForRead("../b/c");
- ASSERT_FALSE(File.getError()) << File.getError() << "\n"
- << NormalizedFS.toString();
- Stat = (*File)->status();
- ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n"
- << NormalizedFS.toString();
- ASSERT_TRUE(Stat->isRegularFile());
- ASSERT_EQ("../b/c", Stat->getName());
-
- // Access using a directory iterator.
- std::error_code EC;
- clang::vfs::directory_iterator It = NormalizedFS.dir_begin("../b", EC);
- ASSERT_EQ("../b/c", It->getName());
-}
-
// NOTE: in the tests below, we use '//root/' as our root directory, since it is
// a legal *absolute* path on Windows as well as *nix.
class VFSFromYAMLTest : public ::testing::Test {
diff --git a/clang/unittests/Driver/ToolChainTest.cpp b/clang/unittests/Driver/ToolChainTest.cpp
index 0d4c545bd79..d4198eaeb1c 100644
--- a/clang/unittests/Driver/ToolChainTest.cpp
+++ b/clang/unittests/Driver/ToolChainTest.cpp
@@ -113,7 +113,7 @@ TEST(ToolChainTest, VFSGCCInstallationRelativeDir) {
std::replace(S.begin(), S.end(), '\\', '/');
#endif
EXPECT_EQ("Found candidate GCC installation: "
- "/home/test/bin/../lib/gcc/arm-linux-gnueabi/4.6.1\n"
+ "/home/test/lib/gcc/arm-linux-gnueabi/4.6.1\n"
"Selected GCC installation: "
"/home/test/bin/../lib/gcc/arm-linux-gnueabi/4.6.1\n"
"Candidate multilib: .;@m32\n"
OpenPOWER on IntegriCloud