[libc-commits] [libc] [libc][bazel] Append '/' to TEST_UNDECLARED_OUTPUTS_DIR (PR #207710)

via libc-commits libc-commits at lists.llvm.org
Mon Jul 6 04:49:01 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Pavel Labath (labath)

<details>
<summary>Changes</summary>

The environment variable does not end with a slash, so we need to add one. Without this, the tests work, but don't achieve the intended effect of writing to the undeclared outputs dir.

---
Full diff: https://github.com/llvm/llvm-project/pull/207710.diff


1 Files Affected:

- (modified) libc/test/UnitTest/BazelFilePath.cpp (+2-2) 


``````````diff
diff --git a/libc/test/UnitTest/BazelFilePath.cpp b/libc/test/UnitTest/BazelFilePath.cpp
index 7f9f42b46dca9..03ac56f083b9c 100644
--- a/libc/test/UnitTest/BazelFilePath.cpp
+++ b/libc/test/UnitTest/BazelFilePath.cpp
@@ -23,9 +23,9 @@ CString libc_make_test_file_path_func(const char *file_name) {
   // Do something sensible if not run under bazel, otherwise this may segfault
   // when constructing the string.
   if (UNDECLARED_OUTPUTS_PATH == nullptr)
-    UNDECLARED_OUTPUTS_PATH = "";
+    return cpp::string(file_name);
 
-  return cpp::string(UNDECLARED_OUTPUTS_PATH) + file_name;
+  return cpp::string(UNDECLARED_OUTPUTS_PATH) + "/" + file_name;
 }
 
 } // namespace testing

``````````

</details>


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


More information about the libc-commits mailing list