[Clang][Test] Add llvm-lto, llvm-lto2 and llvm-profdata to the tool substitutions...
authorWeining Lu <luweining@loongson.cn>
Tue, 14 Feb 2023 00:36:43 +0000 (08:36 +0800)
committerWeining Lu <luweining@loongson.cn>
Wed, 15 Feb 2023 01:16:14 +0000 (09:16 +0800)
Similar to issue fixed in D107155, some lit tests invoke `llvm-lto`,
`llvm-lto2` and `llvm-profdata` without going through the substitution
system. While the test runner correctly picks up these binaries from
the build directory, it doesn't print its absolute path. When copying
the invocations when reproducing test failures, this can result in
`command not found: llvm-lto` or other errors (caused by using wrong
version of the tool).

This patch adds these tools to the `tools` variable in
`clang/test/lit.cfg.py` which will then call add_tool_substitutions.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D143806

clang/test/lit.cfg.py

index cc55c3c..839960e 100644 (file)
@@ -61,6 +61,7 @@ tool_dirs = [config.clang_tools_dir, config.llvm_tools_dir]
 tools = [
     'apinotes-test', 'c-index-test', 'clang-diff', 'clang-format', 'clang-repl', 'clang-offload-packager',
     'clang-tblgen', 'clang-scan-deps', 'opt', 'llvm-ifs', 'yaml2obj', 'clang-linker-wrapper',
+    'llvm-lto', 'llvm-lto2', 'llvm-profdata',
     ToolSubst('%clang_extdef_map', command=FindTool(
         'clang-extdef-mapping'), unresolved='ignore'),
 ]