llvm.org GIT mirror llvm / cc79ed3
[LIT] Fix testing out-of-tree Clang builds Summary: Currently, LIT configures the LLVM binary path before the Clang binary path. However this breaks testing out-of-tree Clang builds (where the LLVM binary path includes a copy of Clang). This patch reverses the order of the paths when looking for Clang, putting the Clang binary directory first. Reviewers: zturner, beanz, chapuni, modocache, EricWF Reviewed By: EricWF Subscribers: mgorny, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D40217 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318607 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Fiselier 1 year, 11 months ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
366366 self.clear_environment(possibly_dangerous_env_vars)
368368 # Tweak the PATH to include the tools dir and the scripts dir.
369 paths = [self.config.llvm_tools_dir]
370 tools = getattr(self.config, 'clang_tools_dir', None)
371 if tools:
372 paths = paths + [tools]
369 # Put Clang first to avoid LLVM from overriding out-of-tree clang builds.
370 possible_paths = ['clang_tools_dir', 'llvm_tools_dir']
371 paths = [getattr(self.config, pp) for pp in possible_paths
372 if getattr(self.config, pp, None)]
373373 self.with_environment('PATH', paths, append_path=True)
375375 paths = [self.config.llvm_shlib_dir, self.config.llvm_libs_dir]