[llvm] 5b8e869 - [llc] Fix save-stats test in read only directories (#167403)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 10 14:48:12 PST 2025


Author: Michael Jones
Date: 2025-11-10T14:48:08-08:00
New Revision: 5b8e86909c94ad81b4c2f0cee50c3433ec318788

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

LOG: [llc] Fix save-stats test in read only directories (#167403)

The save stats test would fail downstream due to the tests being run
from a read only directory. The cwd flag would attempt to place the
statistics in that read only directory, causing an error. This patch
ensures that the tests are always run from a temp directory.

Added: 
    

Modified: 
    llvm/test/tools/llc/save-stats.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llc/save-stats.ll b/llvm/test/tools/llc/save-stats.ll
index 4950625c809cc..a5769f86648dc 100644
--- a/llvm/test/tools/llc/save-stats.ll
+++ b/llvm/test/tools/llc/save-stats.ll
@@ -1,5 +1,6 @@
 ; REQUIRES: asserts
 
+; RUN: rm -rf %t.dir && mkdir -p %t.dir && cd %t.dir
 ; RUN: llc --save-stats=obj -o %t.s %s && cat %t.stats | FileCheck %s
 ; RUN: llc --save-stats=cwd -o %t.s %s && cat %{t:stem}.tmp.stats | FileCheck %s
 ; RUN: llc --save-stats -o %t.s %s && cat %{t:stem}.tmp.stats | FileCheck %s


        


More information about the llvm-commits mailing list