[llvm] r318607 - [LIT] Fix testing out-of-tree Clang builds

Eric Fiselier via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 18 16:00:49 PST 2017


Author: ericwf
Date: Sat Nov 18 16:00:49 2017
New Revision: 318607

URL: http://llvm.org/viewvc/llvm-project?rev=318607&view=rev
Log:
[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

Modified:
    llvm/trunk/utils/lit/lit/llvm/config.py

Modified: llvm/trunk/utils/lit/lit/llvm/config.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/llvm/config.py?rev=318607&r1=318606&r2=318607&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/llvm/config.py (original)
+++ llvm/trunk/utils/lit/lit/llvm/config.py Sat Nov 18 16:00:49 2017
@@ -367,10 +367,10 @@ class LLVMConfig(object):
         self.clear_environment(possibly_dangerous_env_vars)
 
         # Tweak the PATH to include the tools dir and the scripts dir.
-        paths = [self.config.llvm_tools_dir]
-        tools = getattr(self.config, 'clang_tools_dir', None)
-        if tools:
-            paths = paths + [tools]
+        # Put Clang first to avoid LLVM from overriding out-of-tree clang builds.
+        possible_paths = ['clang_tools_dir', 'llvm_tools_dir']
+        paths = [getattr(self.config, pp) for pp in possible_paths
+                 if getattr(self.config, pp, None)]
         self.with_environment('PATH', paths, append_path=True)
 
         paths = [self.config.llvm_shlib_dir, self.config.llvm_libs_dir]




More information about the llvm-commits mailing list