[llvm] [lit] Are all RUN lines skipped in windows cmd? (PR #65242)

Joel E. Denny via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 06:46:14 PDT 2023


jdenny-ornl wrote:

> What is `%dbg` actually used for? I couldn't find any references to it in the main LLVM tests, nor is there any reference to it in the Testing Guid docs, so I suspect I'm missing something crucial to understanding this situation...

It's something like an internal substitution.  When parsing a RUN line, [lit inserts it before the RUN line's commands](https://github.com/llvm/llvm-project/blob/2f8690b1e2bf09174660cd66ef8a27066848555e/llvm/utils/lit/lit/TestRunner.py#L1913) like this:

```
%dbg(RUN: at line N) commands
```

Later, lit expands it based on the shell (internal, external sh-like shell, external windows `cmd`, etc.).  For example, [for sh-like shells](https://github.com/llvm/llvm-project/blob/2f8690b1e2bf09174660cd66ef8a27066848555e/llvm/utils/lit/lit/TestRunner.py#L1186-L1189):

```
: 'RUN: at line N'; commands
```

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


More information about the llvm-commits mailing list