[clang] b2b078a - [clang/CodeGenActionTest] Use the platform's path separator for the `DebugInfoCWDCodeGen` test

Argyrios Kyrtzidis via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 20 13:20:44 PST 2023


Author: Argyrios Kyrtzidis
Date: 2023-01-20T13:20:21-08:00
New Revision: b2b078adc2d00db8dc8f0009e2bfca4d8267149a

URL: https://github.com/llvm/llvm-project/commit/b2b078adc2d00db8dc8f0009e2bfca4d8267149a
DIFF: https://github.com/llvm/llvm-project/commit/b2b078adc2d00db8dc8f0009e2bfca4d8267149a.diff

LOG: [clang/CodeGenActionTest] Use the platform's path separator for the `DebugInfoCWDCodeGen` test

Fixes a failure in some Windows configuration.

Differential Revision: https://reviews.llvm.org/D142238

Added: 
    

Modified: 
    clang/unittests/Frontend/CodeGenActionTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Frontend/CodeGenActionTest.cpp b/clang/unittests/Frontend/CodeGenActionTest.cpp
index d50648ced7daf..a6520910c8399 100644
--- a/clang/unittests/Frontend/CodeGenActionTest.cpp
+++ b/clang/unittests/Frontend/CodeGenActionTest.cpp
@@ -82,9 +82,10 @@ TEST(CodeGenTest, DebugInfoCWDCodeGen) {
   // Check that debug info is accessing the current working directory from the
   // VFS instead of calling \p llvm::sys::fs::current_path() directly.
 
-  auto VFS = std::make_unique<llvm::vfs::InMemoryFileSystem>();
-  VFS->setCurrentWorkingDirectory("/in-memory-fs-cwd");
   auto Sept = llvm::sys::path::get_separator();
+  auto VFS = std::make_unique<llvm::vfs::InMemoryFileSystem>();
+  VFS->setCurrentWorkingDirectory(
+      std::string(llvm::formatv("{0}in-memory-fs-cwd", Sept)));
   std::string TestPath =
       std::string(llvm::formatv("{0}in-memory-fs-cwd{0}test.cpp", Sept));
   VFS->addFile(TestPath, 0, llvm::MemoryBuffer::getMemBuffer("int x;\n"));


        


More information about the cfe-commits mailing list