Commit 6ea4eb4b authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

testsuite: Make ghc_built_by_llvm check more precise

Previously it would hackily look at the flavour name to determine
whether LLVM was used to build stage2 ghc. However, this didn't work at
all with Hadrian and would miss cases like ARM where we use the LLVM
backend by default.

See #16087 for the motivation for why ghc_built_by_llvm is needed at
all. This should catch one of the ARMv7 failures described in #17555.
parent 7cef0b7d
......@@ -93,9 +93,6 @@ runTestBuilderArgs = builder RunTest ? do
let timeoutProg = root -/- timeoutPath
statsFilesDir <- expr haddockStatsFilesDir
-- See #16087
let ghcBuiltByLlvm = False -- TODO: Implement this check
let asBool :: String -> Bool -> String
asBool s b = s ++ show b
......@@ -128,7 +125,6 @@ runTestBuilderArgs = builder RunTest ? do
, arg "-e", arg $ "config.ghc_dynamic_by_default=" ++ show hasDynamicByDefault
, arg "-e", arg $ "config.ghc_dynamic=" ++ show hasDynamic
, arg "-e", arg $ "config.ghc_built_by_llvm=" ++ show ghcBuiltByLlvm
, arg "-e", arg $ "config.top=" ++ show (top -/- "testsuite")
, arg "-e", arg $ "config.wordsize=" ++ show wordsize
......
......@@ -179,6 +179,15 @@ def get_compiler_info():
config.have_ncg = compilerInfoDict.get("Have native code generator", "NO") == "YES"
# 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.
#
# The condition here is a bit approximate: we assume that if stage2 doesn't
# have the NCG and isn't unregisterised then it must be using the LLVM
# backend by default.
config.ghc_built_by_llvm = not config.have_ncg and not config.unregisterised
config.have_RTS_linker = compilerInfoDict.get("target has RTS linker", "NO") == "YES"
# external interpreter needs RTS linker support
# If the field is not present (GHC 8.0 and earlier), assume we don't
......@@ -220,6 +229,7 @@ def get_compiler_info():
config.ghc_plugin_way = "normal"
# Note [Replacing backward slashes in config.libdir]
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# We *do* need to replace backslashes in config.libdir, for the following
# reason:
......
......@@ -178,6 +178,7 @@ else
RUNTEST_OPTS += -e ghc_with_smp=False
endif
# Does the LLVM backend work?
ifeq "$(LLC)" ""
RUNTEST_OPTS += -e ghc_with_llvm=False
else ifeq "$(TargetARCH_CPP)" "powerpc"
......@@ -244,13 +245,6 @@ else
RUNTEST_OPTS += -e config.local=True
endif
# Some tests in ext-interp fail when ghc-stage2 is built using LLVM. See #16087
ifeq "$(findstring llvm,$(BUILD_FLAVOUR))" ""
RUNTEST_OPTS += -e config.ghc_built_by_llvm=False
else
RUNTEST_OPTS += -e config.ghc_built_by_llvm=True
endif
RUNTEST_OPTS += \
--rootdir=. \
--config-file=$(CONFIG) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment