Skip to content
Snippets Groups Projects
Commit 4597df07 authored by Cheng Shao's avatar Cheng Shao :beach:
Browse files

hadrian/testsuite: implement config.cross logic

This commit implements the config.cross field in the testsuite driver.
It comes from the "cross compiling" ghc info field for both
in-tree/out-of-tree GHC, and is an accurate predicate of whether we're
cross-compiling or not (compared to the precense of target emulator),
and is useful to implement predicates to assert the precense of
internal interpreter (only available on non-cross GHC) for tests that
do require it (e.g. plugins).

(cherry picked from commit 2956a3f7)
(cherry picked from commit 5500e1b3)
parent 91fe5d97
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@ data TestSetting = TestHostOS
| TestGhcDebugAssertions
| TestGhcWithNativeCodeGen
| TestGhcWithInterpreter
| TestGhcCrossCompiling
| TestGhcWithRtsLinker
| TestGhcUnregisterised
| TestGhcTablesNextToCode
......@@ -62,6 +63,7 @@ testSetting key = do
TestGhcDebugAssertions -> "GhcDebugAssertions"
TestGhcWithNativeCodeGen -> "GhcWithNativeCodeGen"
TestGhcWithInterpreter -> "GhcWithInterpreter"
TestGhcCrossCompiling -> "CrossCompiling"
TestGhcWithRtsLinker -> "GhcWithRtsLinker"
TestGhcUnregisterised -> "GhcUnregisterised"
TestGhcTablesNextToCode -> "GhcTablesNextToCode"
......@@ -126,4 +128,3 @@ stageOfTestCompiler "stage1" = Just stage0InTree
stageOfTestCompiler "stage2" = Just Stage1
stageOfTestCompiler "stage3" = Just Stage2
stageOfTestCompiler _ = Nothing
......@@ -65,6 +65,7 @@ data TestCompilerArgs = TestCompilerArgs{
, leadingUnderscore :: Bool
, withNativeCodeGen :: Bool
, withInterpreter :: Bool
, cross :: Bool
, unregisterised :: Bool
, tables_next_to_code :: Bool
, targetWithSMP :: Bool -- does the target support SMP
......@@ -156,6 +157,7 @@ outOfTreeCompilerArgs = do
leadingUnderscore <- getBooleanSetting TestLeadingUnderscore
withNativeCodeGen <- getBooleanSetting TestGhcWithNativeCodeGen
withInterpreter <- getBooleanSetting TestGhcWithInterpreter
cross <- getBooleanSetting TestGhcCrossCompiling
unregisterised <- getBooleanSetting TestGhcUnregisterised
tables_next_to_code <- getBooleanSetting TestGhcTablesNextToCode
targetWithSMP <- targetSupportsSMP
......@@ -272,6 +274,7 @@ runTestBuilderArgs = builder Testsuite ? do
, arg "-e", arg $ "config.have_interp=" ++ show withInterpreter
, arg "-e", arg $ "config.cross=" ++ show cross
, arg "-e", arg $ "config.unregisterised=" ++ show unregisterised
, arg "-e", arg $ "config.tables_next_to_code=" ++ show tables_next_to_code
......
......@@ -139,6 +139,9 @@ class TestConfig:
# Do we have interpreter support?
self.have_interp = False
# Are we cross-compiling?
self.cross = False
# Do we have RTS linker?
self.have_RTS_linker = False
......
......@@ -22,6 +22,7 @@ main = do
getGhcFieldOrFail fields "GhcDebugAssertions" "Debug on"
getGhcFieldOrFail fields "GhcWithNativeCodeGen" "Have native code generator"
getGhcFieldOrFail fields "GhcWithInterpreter" "Have interpreter"
getGhcFieldOrFail fields "CrossCompiling" "cross compiling"
getGhcFieldOrFail fields "GhcWithRtsLinker" "target has RTS linker"
getGhcFieldOrFail fields "GhcUnregisterised" "Unregisterised"
getGhcFieldOrFail fields "GhcWithSMP" "Support SMP"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment