mehdi_amini added a comment. An alternative to checking for the existence of the file is to change `llvm/test/lit.site.cfg.in` to add to the config the value of `LLVM_TOOL_LTO_BUILD`, and it would be available directly here. https://reviews.llvm.org/D27739