[compiler-rt] [Sanitizer] Use %device_rundir/ to fix test (PR #142274)

via llvm-commits llvm-commits at lists.llvm.org
Sat May 31 07:24:19 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Ellis Hoag (ellishg)

<details>
<summary>Changes</summary>

I attempted to fix this test in https://github.com/llvm/llvm-project/pull/142235 but we a new error.

https://lab.llvm.org/buildbot/#/builders/186/builds/9524/steps/26/logs/stdio
> ERROR: Can't create directory: /var

The path we want is actually at `/data/local/tmp/Output/var/...`.

I found `%device_rundir/` evaluates to this prefix on android, and nothing otherwise.

https://github.com/llvm/llvm-project/blob/f057a593a7151437edd25cfbbdcf450139346f12/compiler-rt/test/lit.common.cfg.py#L658

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


1 Files Affected:

- (modified) compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp (+1-1) 


``````````diff
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp
index 8abd476708b4c..cebe19afb1bd8 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp
@@ -1,6 +1,6 @@
 // Test __sanitizer_set_report_path and __sanitizer_get_report_path:
 // RUN: %clangxx -O2 %s -o %t
-// RUN: %env HOME=%t.homedir TMPDIR=%t.tmpdir %run %t 2>&1 | FileCheck %s
+// RUN: %env HOME=%device_rundir/%t.homedir TMPDIR=%device_rundir/%t.tmpdir %run %t 2>&1 | FileCheck %s
 
 #include <sanitizer/common_interface_defs.h>
 #include <stdio.h>

``````````

</details>


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


More information about the llvm-commits mailing list