diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py index 05b5f02b9bd9a..867a44be56727 100644 --- a/llvm/test/lit.cfg.py +++ b/llvm/test/lit.cfg.py @@ -20,8 +20,8 @@ # testFormat: The test format to use to interpret tests. extra_substitutions = extra_substitutions = ( [ - (r"\| not FileCheck .*", "> /dev/null"), - (r"\| FileCheck .*", "> /dev/null"), + (r"FileCheck .*", "cat > /dev/null"), + (r"not FileCheck .*", "cat > /dev/null"), ] if config.enable_profcheck else [] @@ -39,6 +39,16 @@ # directories. config.excludes = ["Inputs", "CMakeLists.txt", "README.txt", "LICENSE.txt"] +# Exclude llvm-reduce tests for profcheck because we substitute the FileCheck +# binary with a no-op command for profcheck, but llvm-reduce tests have RUN +# commands of the form llvm-reduce --test FileCheck, which explode if we +# substitute FileCheck because llvm-reduce expects FileCheck in these tests. +# It's not really possible to exclude these tests from the command substitution, +# so we just exclude llvm-reduce tests from this config altogether. This should +# be fine though as profcheck config tests are mostly concerned with opt. +if config.enable_profcheck: + config.excludes = config.excludes + ["llvm-reduce"] + # test_source_root: The root path where tests are located. config.test_source_root = os.path.dirname(__file__)