Skip to content
Snippets Groups Projects
Commit a4dba8dc authored by Cheng Shao's avatar Cheng Shao
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 418cba92
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ data TestSetting = TestHostOS ...@@ -30,6 +30,7 @@ data TestSetting = TestHostOS
| TestGhcDebugAssertions | TestGhcDebugAssertions
| TestGhcWithNativeCodeGen | TestGhcWithNativeCodeGen
| TestGhcWithInterpreter | TestGhcWithInterpreter
| TestGhcCrossCompiling
| TestGhcWithRtsLinker | TestGhcWithRtsLinker
| TestGhcUnregisterised | TestGhcUnregisterised
| TestGhcTablesNextToCode | TestGhcTablesNextToCode
...@@ -62,6 +63,7 @@ testSetting key = do ...@@ -62,6 +63,7 @@ testSetting key = do
TestGhcDebugAssertions -> "GhcDebugAssertions" TestGhcDebugAssertions -> "GhcDebugAssertions"
TestGhcWithNativeCodeGen -> "GhcWithNativeCodeGen" TestGhcWithNativeCodeGen -> "GhcWithNativeCodeGen"
TestGhcWithInterpreter -> "GhcWithInterpreter" TestGhcWithInterpreter -> "GhcWithInterpreter"
TestGhcCrossCompiling -> "CrossCompiling"
TestGhcWithRtsLinker -> "GhcWithRtsLinker" TestGhcWithRtsLinker -> "GhcWithRtsLinker"
TestGhcUnregisterised -> "GhcUnregisterised" TestGhcUnregisterised -> "GhcUnregisterised"
TestGhcTablesNextToCode -> "GhcTablesNextToCode" TestGhcTablesNextToCode -> "GhcTablesNextToCode"
...@@ -126,4 +128,3 @@ stageOfTestCompiler "stage1" = Just stage0InTree ...@@ -126,4 +128,3 @@ stageOfTestCompiler "stage1" = Just stage0InTree
stageOfTestCompiler "stage2" = Just Stage1 stageOfTestCompiler "stage2" = Just Stage1
stageOfTestCompiler "stage3" = Just Stage2 stageOfTestCompiler "stage3" = Just Stage2
stageOfTestCompiler _ = Nothing stageOfTestCompiler _ = Nothing
...@@ -65,6 +65,7 @@ data TestCompilerArgs = TestCompilerArgs{ ...@@ -65,6 +65,7 @@ data TestCompilerArgs = TestCompilerArgs{
, leadingUnderscore :: Bool , leadingUnderscore :: Bool
, withNativeCodeGen :: Bool , withNativeCodeGen :: Bool
, withInterpreter :: Bool , withInterpreter :: Bool
, cross :: Bool
, unregisterised :: Bool , unregisterised :: Bool
, tables_next_to_code :: Bool , tables_next_to_code :: Bool
, targetWithSMP :: Bool -- does the target support SMP , targetWithSMP :: Bool -- does the target support SMP
...@@ -156,6 +157,7 @@ outOfTreeCompilerArgs = do ...@@ -156,6 +157,7 @@ outOfTreeCompilerArgs = do
leadingUnderscore <- getBooleanSetting TestLeadingUnderscore leadingUnderscore <- getBooleanSetting TestLeadingUnderscore
withNativeCodeGen <- getBooleanSetting TestGhcWithNativeCodeGen withNativeCodeGen <- getBooleanSetting TestGhcWithNativeCodeGen
withInterpreter <- getBooleanSetting TestGhcWithInterpreter withInterpreter <- getBooleanSetting TestGhcWithInterpreter
cross <- getBooleanSetting TestGhcCrossCompiling
unregisterised <- getBooleanSetting TestGhcUnregisterised unregisterised <- getBooleanSetting TestGhcUnregisterised
tables_next_to_code <- getBooleanSetting TestGhcTablesNextToCode tables_next_to_code <- getBooleanSetting TestGhcTablesNextToCode
targetWithSMP <- targetSupportsSMP targetWithSMP <- targetSupportsSMP
...@@ -272,6 +274,7 @@ runTestBuilderArgs = builder Testsuite ? do ...@@ -272,6 +274,7 @@ runTestBuilderArgs = builder Testsuite ? do
, arg "-e", arg $ "config.have_interp=" ++ show withInterpreter , 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.unregisterised=" ++ show unregisterised
, arg "-e", arg $ "config.tables_next_to_code=" ++ show tables_next_to_code , arg "-e", arg $ "config.tables_next_to_code=" ++ show tables_next_to_code
......
...@@ -139,6 +139,9 @@ class TestConfig: ...@@ -139,6 +139,9 @@ class TestConfig:
# Do we have interpreter support? # Do we have interpreter support?
self.have_interp = False self.have_interp = False
# Are we cross-compiling?
self.cross = False
# Do we have RTS linker? # Do we have RTS linker?
self.have_RTS_linker = False self.have_RTS_linker = False
......
...@@ -22,6 +22,7 @@ main = do ...@@ -22,6 +22,7 @@ main = do
getGhcFieldOrFail fields "GhcDebugAssertions" "Debug on" getGhcFieldOrFail fields "GhcDebugAssertions" "Debug on"
getGhcFieldOrFail fields "GhcWithNativeCodeGen" "Have native code generator" getGhcFieldOrFail fields "GhcWithNativeCodeGen" "Have native code generator"
getGhcFieldOrFail fields "GhcWithInterpreter" "Have interpreter" getGhcFieldOrFail fields "GhcWithInterpreter" "Have interpreter"
getGhcFieldOrFail fields "CrossCompiling" "cross compiling"
getGhcFieldOrFail fields "GhcWithRtsLinker" "target has RTS linker" getGhcFieldOrFail fields "GhcWithRtsLinker" "target has RTS linker"
getGhcFieldOrFail fields "GhcUnregisterised" "Unregisterised" getGhcFieldOrFail fields "GhcUnregisterised" "Unregisterised"
getGhcFieldOrFail fields "GhcWithSMP" "Support SMP" 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