diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-07 08:32:50 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-07 08:32:50 +0000 |
commit | d5e0b58ef253c7db7668a15b63eb122b0a879df5 (patch) | |
tree | 4ee7c8a4f84634b14dd9501f46494f29141221f2 /clang/unittests/Basic/VirtualFileSystemTest.cpp | |
parent | 92aa1c02df82d06ea4fb56ce78b5c0ea56c1da3a (diff) | |
download | bcm5719-llvm-d5e0b58ef253c7db7668a15b63eb122b0a879df5.tar.gz bcm5719-llvm-d5e0b58ef253c7db7668a15b63eb122b0a879df5.zip |
[VFS] Also drop '.' when adding files to an in-memory FS.
Otherwise we won't be able to find them later.
llvm-svn: 249525
Diffstat (limited to 'clang/unittests/Basic/VirtualFileSystemTest.cpp')
-rw-r--r-- | clang/unittests/Basic/VirtualFileSystemTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Basic/VirtualFileSystemTest.cpp b/clang/unittests/Basic/VirtualFileSystemTest.cpp index cca99a94730..6ed811f22f3 100644 --- a/clang/unittests/Basic/VirtualFileSystemTest.cpp +++ b/clang/unittests/Basic/VirtualFileSystemTest.cpp @@ -568,6 +568,7 @@ TEST_F(InMemoryFileSystemTest, OverlayFileNoOwn) { TEST_F(InMemoryFileSystemTest, OpenFileForRead) { FS.addFile("/a", 0, MemoryBuffer::getMemBuffer("a")); + FS.addFile("././c", 0, MemoryBuffer::getMemBuffer("c")); auto File = FS.openFileForRead("/a"); ASSERT_EQ("a", (*(*File)->getBuffer("ignored"))->getBuffer()); File = FS.openFileForRead("/a"); // Open again. @@ -578,6 +579,8 @@ TEST_F(InMemoryFileSystemTest, OpenFileForRead) { ASSERT_EQ(File.getError(), errc::invalid_argument) << FS.toString(); File = FS.openFileForRead("/b"); ASSERT_EQ(File.getError(), errc::no_such_file_or_directory) << FS.toString(); + File = FS.openFileForRead("./c"); + ASSERT_EQ("c", (*(*File)->getBuffer("ignored"))->getBuffer()); } TEST_F(InMemoryFileSystemTest, DirectoryIteration) { |