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

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 24 02:05:26 PDT 2025


Author: David Spickett
Date: 2025-10-24T10:05:22+01:00
New Revision: ed87795aa6a0ea7bc49cd9257ff363e220f35872

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

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

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

https://llvm.org/docs/CommandGuide/lit.html#substitutions

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 a unique path, which can be used
to make files or folders.

Added: 
    

Modified: 
    llvm/docs/CommandGuide/lit.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/CommandGuide/lit.rst b/llvm/docs/CommandGuide/lit.rst
index 70daae46170cd..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                      temporary file name 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