[llvm] [llvm][docs] Correct description of %t lit substitution (PR #164397)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 04:28:35 PDT 2025


https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/164397

>From 46365a0e49a14e47412cc356bdcc967c041acd9a Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Tue, 21 Oct 2025 11:05:12 +0000
Subject: [PATCH 1/2] [llvm][docs] Correct description of %t lit substitution

%t is currently documented as:
temporary file name unique to the test

Which I take to mean if the path is a/b/c/tempfile, then
%t would be tempfile. It is not, it's the whole path.

(which is hinted at by %basename_t, but why would you read
that if you didn't need to use it)

As seen in #164396 this can create confusion when people use
it as if it were just the file name.

Make it clear in the docs that this is the path of a file.
---
 llvm/docs/CommandGuide/lit.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/docs/CommandGuide/lit.rst b/llvm/docs/CommandGuide/lit.rst
index 70daae46170cd..89adb003832ef 100644
--- a/llvm/docs/CommandGuide/lit.rst
+++ b/llvm/docs/CommandGuide/lit.rst
@@ -628,7 +628,7 @@ TestRunner.py:
  %{fs-src-root}          root component of file system paths pointing to the LLVM checkout
  %{fs-tmp-root}          root component of file system paths pointing to the test's temporary directory
  %{fs-sep}               file system path separator
- %t                      temporary file name unique to the test
+ %t                      the path of a temporary file unique to the test
  %basename_t             The last path component of %t but without the ``.tmp`` extension (deprecated, use ``%{t:stem}`` instead)
  %%                      %
  %/s                     %s but ``\`` is replaced by ``/``

>From c54153ef74d414d258228c9769f0c53b69069f37 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Tue, 21 Oct 2025 11:27:45 +0000
Subject: [PATCH 2/2] it's just a path not a real file or dir

---
 llvm/docs/CommandGuide/lit.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/docs/CommandGuide/lit.rst b/llvm/docs/CommandGuide/lit.rst
index 89adb003832ef..bbc149740494a 100644
--- a/llvm/docs/CommandGuide/lit.rst
+++ b/llvm/docs/CommandGuide/lit.rst
@@ -628,7 +628,7 @@ TestRunner.py:
  %{fs-src-root}          root component of file system paths pointing to the LLVM checkout
  %{fs-tmp-root}          root component of file system paths pointing to the test's temporary directory
  %{fs-sep}               file system path separator
- %t                      the path of a temporary file unique to the test
+ %t                      a path unique to the test (which may be used to make files or directories)
  %basename_t             The last path component of %t but without the ``.tmp`` extension (deprecated, use ``%{t:stem}`` instead)
  %%                      %
  %/s                     %s but ``\`` is replaced by ``/``



More information about the llvm-commits mailing list