llvm-project/llvm/utils/lit/tests/Inputs
Andrew Savonichev 1041a9642b [lit] Support %if ... %else syntax for RUN lines
This syntax allows to modify RUN lines based on features
available. For example:

    RUN: ... | FileCheck %s --check-prefix=%if windows %{CHECK-W%} %else %{CHECK-NON-W%}
    CHECK-W: ...
    CHECK-NON-W: ...

The whole command can be put under %if ... %else:

    RUN: %if tool_available %{ %tool %} %else %{ true %}

or:

    RUN: %if tool_available %{ %tool %}

If tool_available feature is missing, we'll have an empty command in
this RUN line.  LIT used to emit an error for empty commands, but now
it treats such commands as nop in all cases.

Multi-line expressions are also supported:

    RUN: %if tool_available %{ \
    RUN:   %tool               \
    RUN: %} %else %{           \
    RUN:   true                \
    RUN: %}

Background and motivation:
D121727 [NVPTX] Integrate ptxas to LIT tests
https://reviews.llvm.org/D121727

Differential Revision: https://reviews.llvm.org/D122569
2022-04-27 20:29:08 +03:00
..
allow-retries
config-map-discovery
custom-result-category
discovery
exec-discovery
exec-discovery-in-tree
fake-externals
googletest-cmd-wrapper [Reland][lit] Use sharding for GoogleTest format 2022-04-12 14:51:12 -07:00
googletest-crash [lit] Keep stdout/stderr when using GoogleTest format 2022-04-25 12:26:03 -07:00
googletest-discovery-failed
googletest-format [lit] Keep stdout/stderr when using GoogleTest format 2022-04-25 12:26:03 -07:00
googletest-timeout [lit] Keep stdout/stderr when using GoogleTest format 2022-04-25 12:26:03 -07:00
ignore-fail
lit-opts
lld-features
max-failures
max-time
parallelism-groups
progress-bar
py-config-discovery
reorder
show-result-codes
show-used-features
shtest-env
shtest-format Revert "Reapply "[lit] Have REQUIRES support the target triple"" 2021-08-09 12:14:57 -07:00
shtest-format-argv0
shtest-if-else [lit] Support %if ... %else syntax for RUN lines 2022-04-27 20:29:08 +03:00
shtest-inject
shtest-keyword-parse-errors
shtest-not
shtest-output-printing
shtest-recursive-substitution
shtest-run-at-line
shtest-shell
shtest-timeout
standalone-tests
standalone-tests-with-excludes
standalone-tests-with-suffixes
test-data
test-data-micro
test_retry_attempts
testrunner-custom-parsers
unittest-adaptor
unparsed-requirements
use-llvm-tool
use-llvm-tool-required
xfail-cl
xunit-output Revert "Reapply "[lit] Have REQUIRES support the target triple"" 2021-08-09 12:14:57 -07:00
lit.cfg