summaryrefslogtreecommitdiff
path: root/testsuite/config
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-08-10 15:53:51 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-08-18 22:11:36 -0400
commitaa4b744d51aa6bdb46064f981ea8e001627921d6 (patch)
tree47f54e297ec6ea60268a86f0b6c85afd8e8ca6a3 /testsuite/config
parent9ad5cab33b8b78a346896cc6de555365c73e6298 (diff)
downloadhaskell-aa4b744d51aa6bdb46064f981ea8e001627921d6.tar.gz
testsuite: Only run llvm ways if llc is available
As noted in #18560, we previously would always run the LLVM ways since `configure` would set `SettingsLlcCommand` to something non-null when it otherwise couldn't find the `llc` executable. Now we rather probe for the existence of the `llc` executable in the testsuite driver. Fixes #18560.
Diffstat (limited to 'testsuite/config')
-rw-r--r--testsuite/config/ghc15
1 files changed, 11 insertions, 4 deletions
diff --git a/testsuite/config/ghc b/testsuite/config/ghc
index 4f053eb50f..c54ac6b385 100644
--- a/testsuite/config/ghc
+++ b/testsuite/config/ghc
@@ -64,10 +64,6 @@ else:
if (config.have_profiling and ghc_with_threaded_rts):
config.run_ways.append('profthreaded')
-if (ghc_with_llvm and not config.unregisterised):
- config.compile_ways.append('optllvm')
- config.run_ways.append('optllvm')
-
# WinIO I/O manager for Windows
if windows:
winio_ways = ['winio', 'winio_threaded']
@@ -195,6 +191,17 @@ def get_compiler_info():
config.have_ncg = compilerInfoDict.get("Have native code generator", "NO") == "YES"
+ # Detect whether an LLVM toolhain is available
+ llc_path = compilerInfoDict.get("LLVM llc command")
+ config.have_llvm = shutil.which(llc_path) is not None
+ if config.unregisterised:
+ print("Unregisterised build; skipping LLVM ways...")
+ elif config.have_llvm:
+ config.compile_ways.append('optllvm')
+ config.run_ways.append('optllvm')
+ else:
+ print("Failed to find `llc` command; skipping LLVM ways...")
+
# Whether GHC itself was built using the LLVM backend. We need to know this
# since some tests in ext-interp fail when stage2 ghc is built using
# LLVM. See #16087.