[libcxx] [llvm] [lit] Remove support for %T (PR #160028)

Abhishek Varma via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 8 10:53:00 PDT 2025


Abhishek-Varma wrote:

> What was your downstream test trying to do with `%T`?
> 
> `%T` expanded to a directory name based on the name of the test source directory and which will probably already exist. `%t` expands to a name based on the path to the test source, which probably doesn't exist. `%t.dir` is nothing special - it's just the `%t` expansion with ".dir" added to the end. You'll likely need to manually create the directory yourself in this case, e.g. something like the following at the start of the test might be worth doing:
> 
> ```
> # RUN: rm -rf %t.dir && mkdir %t.dir
> # RUN: some-command -o %t.dir/foo
> ```

In the downstream project I tried doing the following :-
```
// RUN: mkdir -p %t.dir
// RUN: (some-command %s %t.dir)
```
But this works for Linux but for Windows the same lit test doesn't seem to be working and gives lot of `File could not be opened, fopen Error: No such file or directory` - so was trying to understand how are we supposed to go about this.

Two cases where we currently use `%T` are :-
CASE 1: 
```
// RUN: some-command %s %T
```
CASE 2:
```
// RUN: some-command %s %T
// RUN: some-opt --pass-pipeline{pipeline-flag-using-path=%T} %s
```

For the above to cases I replaced `%T` with `%t.dir` and included a `mkdir -p %t.dir` but it only worked for Linux and NOT for Windows.

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


More information about the llvm-commits mailing list