[clang-tools-extra] [clangd] Add background index path mapping (PR #180285)

Aleksandr Platonov via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 16 01:00:45 PST 2026


================
@@ -1031,5 +1035,37 @@ TEST(BackgroundIndex, Profile) {
               UnorderedElementsAre(Pair("slabs", _), Pair("index", _)));
 }
 
+// Verify shard filenames are unchanged when no path mappings are used
+TEST(BackgroundIndexStorage, ShardFilenameUnchangedWithoutPathMappings) {
+  llvm::SmallString<256> TempDir;
+  ASSERT_FALSE(llvm::sys::fs::createUniqueDirectory("clangd-test", TempDir));
+  llvm::scope_exit Cleanup([&] { llvm::sys::fs::remove_directories(TempDir); });
----------------
ArcsinX wrote:

Instead of a real file system, you should use `MemoryShardStorage` here. We typically don't create real files in unit tests. Files may remain on disk during crashes.

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


More information about the cfe-commits mailing list