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

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Sat May 31 07:23:47 PDT 2025


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

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

>From 0fe6fe0c22fd723057ef18be1ca33e7fe33b61be Mon Sep 17 00:00:00 2001
From: Ellis Hoag <ellis.sparky.hoag at gmail.com>
Date: Sat, 31 May 2025 07:20:16 -0700
Subject: [PATCH] [Sanitizer] Use %device_rundir to fix test

---
 .../TestCases/Posix/sanitizer_set_report_path_test.cpp          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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>



More information about the llvm-commits mailing list