From 9980c261df44e62b1a374c58a94c55c76e1e50a7 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 26 Jul 2018 18:55:02 +0000 Subject: [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name Summary: InMemoryFileSystem::status behaves differently than RealFileSystem::status. The Name contained in the Status returned by RealFileSystem::status will be the path as requested by the caller, whereas InMemoryFileSystem::status returns the normalized path. For example, when requested the status for "../src/first.h", RealFileSystem returns a Status with "../src/first.h" as the Name. InMemoryFileSystem returns "/absolute/path/to/src/first.h". The reason for this change is that I want to make a unit test in the clangd testsuite (where we use an InMemoryFileSystem) to reproduce a bug I get with the clangd program (where a RealFileSystem is used). This difference in behavior "hides" the bug in the unit test version. Reviewers: malaperle, ilya-biryukov, bkramer Subscribers: cfe-commits, ioeric, ilya-biryukov, bkramer, hokein, omtcyfz Differential Revision: https://reviews.llvm.org/D48903 llvm-svn: 338057 --- clang/unittests/Driver/ToolChainTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/unittests/Driver/ToolChainTest.cpp') diff --git a/clang/unittests/Driver/ToolChainTest.cpp b/clang/unittests/Driver/ToolChainTest.cpp index d4198eaeb1c..0d4c545bd79 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/lib/gcc/arm-linux-gnueabi/4.6.1\n" + "/home/test/bin/../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" -- cgit v1.2.3