[PATCH] D122569: [lit] Support %if ... %else syntax for RUN lines
Andrew Savonichev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 28 12:47:08 PDT 2022
asavonic added a comment.
In D122569#3412197 <https://reviews.llvm.org/D122569#3412197>, @delcypher wrote:
> Is
>
> FileCheck %s --check-prefix={%if windows {W} else {NON-W}}
>
> the main motivating example? You can already solve that by introducing a `%check_prefix` substitution in your `lit.cfg.py` file and expanding it to the correct thing depending on your platform. Would that suffice?
The main motivation is integration of external tools (ptxas, see D121727 <https://reviews.llvm.org/D121727>), where (1) it is important to make it clear that a command may not execute if the corresponding tool is not available, and (2) we need to support output redirection, different options for different tests, etc. Doing this in lit.cfg is either not clear, or not flexible (see https://reviews.llvm.org/D121727?id=416283, where we have `ptxas-verify` implemented in lit.cfg in comparison with if-like syntax).
Having this feature implemented as a substitution allows us to use it for other things, like platform dependent prefixes.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122569/new/
https://reviews.llvm.org/D122569
More information about the llvm-commits
mailing list