[PATCH] D40217: [LIT] Fix testing out-of-tree Clang builds

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 18 14:24:30 PST 2017


EricWF created this revision.
Herald added a reviewer: modocache.

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.


https://reviews.llvm.org/D40217

Files:
  utils/lit/lit/llvm/config.py


Index: utils/lit/lit/llvm/config.py
===================================================================
--- utils/lit/lit/llvm/config.py
+++ utils/lit/lit/llvm/config.py
@@ -369,8 +369,9 @@
         # 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)
+        # Put Clang first to avoid LLVM from overriding out-of-tree clang builds.
         if tools:
-            paths = paths + [tools]
+            paths = [tools] + paths
         self.with_environment('PATH', paths, append_path=True)
 
         paths = [self.config.llvm_shlib_dir, self.config.llvm_libs_dir]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40217.123480.patch
Type: text/x-patch
Size: 686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171118/a8f3b5f8/attachment.bin>


More information about the cfe-commits mailing list