Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,12 @@ def open_check_file(file_name):
if not sycl_ls:
lit_config.fatal("can't find `sycl-ls`")

llvm_link = FindTool("llvm-link").resolve(
llvm_config, os.pathsep.join([config.dpcpp_bin_dir, config.llvm_tools_dir])
)
if not llvm_link:
lit_config.fatal("can't find `llvm-link`")

Comment on lines +657 to +662
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToolSubst can accept FindTool as a command and unresolved can be set to fatal - all functionality is already there, why do we need a manual error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate call to FindTool::resolve() is needed to tell scripts to look only in our folders, not everywhere in env on a testing machine, and I guess if llvm_link variable is None, ToolSubst on line 842 will start looking for the tool we pass as the first arg - for "llvm-link", and it will find it in the path (it will find llorg's llvm-link), and overall ToolSubst will not fail even if change unresolved= from "ignore" to "fatal" , so we need to prevent that situation by throwing error earlier, which was done on line 661.

if (
len(config.sycl_build_targets) == 1
and next(iter(config.sycl_build_targets)) == "target-all"
Expand Down Expand Up @@ -821,7 +827,6 @@ def remove_level_zero_suffix(devices):
# Tools for which we add a corresponding feature when available.
feature_tools = [
ToolSubst("llvm-spirv", unresolved="ignore"),
ToolSubst("llvm-link", unresolved="ignore"),
ToolSubst("opencl-aot", unresolved="ignore"),
ToolSubst("ocloc", unresolved="ignore"),
]
Expand All @@ -834,6 +839,7 @@ def remove_level_zero_suffix(devices):
r"\| \bnot\b", command=FindTool("not"), verbatim=True, unresolved="ignore"
),
ToolSubst("sycl-ls", command=sycl_ls, unresolved="fatal"),
ToolSubst("llvm-link", command=llvm_link, unresolved="ignore"),
ToolSubst("syclbin-dump", unresolved="fatal"),
ToolSubst("llvm-ar", unresolved="fatal"),
ToolSubst("clang-offload-bundler", unresolved="fatal"),
Expand Down
Loading