[llvm] [clang] Fix handling of adding a file with the same name as an existing dir to VFS (PR #94461)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 02:34:38 PDT 2024


================
@@ -1138,6 +1138,8 @@ TEST_F(InMemoryFileSystemTest, DuplicatedFile) {
   ASSERT_FALSE(FS.addFile("/a/b", 0, MemoryBuffer::getMemBuffer("a")));
   ASSERT_TRUE(FS.addFile("/a", 0, MemoryBuffer::getMemBuffer("a")));
   ASSERT_FALSE(FS.addFile("/a", 0, MemoryBuffer::getMemBuffer("b")));
+  ASSERT_TRUE(FS.addFile("/b/c/d", 0, MemoryBuffer::getMemBuffer("a")));
+  ASSERT_FALSE(FS.addFile("/b/c", 0, MemoryBuffer::getMemBuffer("a")));
----------------
jensmassberg wrote:

I have added an additional test case.

https://github.com/llvm/llvm-project/pull/94461


More information about the llvm-commits mailing list