summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hadrian/src/Oracles/TestSettings.hs6
-rw-r--r--hadrian/src/Settings/Builders/RunTest.hs9
-rw-r--r--testsuite/driver/testglobals.py3
-rw-r--r--testsuite/driver/testlib.py3
-rw-r--r--testsuite/ghc-config/ghc-config.hs3
-rw-r--r--testsuite/mk/test.mk2
6 files changed, 21 insertions, 5 deletions
diff --git a/hadrian/src/Oracles/TestSettings.hs b/hadrian/src/Oracles/TestSettings.hs
index fc204c26c1..6abcb88daf 100644
--- a/hadrian/src/Oracles/TestSettings.hs
+++ b/hadrian/src/Oracles/TestSettings.hs
@@ -25,8 +25,9 @@ data TestSetting = TestHostOS
| TestTARGETPLATFORM
| TestTargetOS_CPP
| TestTargetARCH_CPP
+ | TestRTSWay
| TestGhcStage
- | TestGhcDebugged
+ | TestGhcDebugAssertions
| TestGhcWithNativeCodeGen
| TestGhcWithInterpreter
| TestGhcWithRtsLinker
@@ -56,8 +57,9 @@ testSetting key = do
TestTARGETPLATFORM -> "TARGETPLATFORM"
TestTargetOS_CPP -> "TargetOS_CPP"
TestTargetARCH_CPP -> "TargetARCH_CPP"
+ TestRTSWay -> "RTSWay"
TestGhcStage -> "GhcStage"
- TestGhcDebugged -> "GhcDebugged"
+ TestGhcDebugAssertions -> "GhcDebugAssertions"
TestGhcWithNativeCodeGen -> "GhcWithNativeCodeGen"
TestGhcWithInterpreter -> "GhcWithInterpreter"
TestGhcWithRtsLinker -> "GhcWithRtsLinker"
diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs
index 60de539a12..1a0f411d97 100644
--- a/hadrian/src/Settings/Builders/RunTest.hs
+++ b/hadrian/src/Settings/Builders/RunTest.hs
@@ -69,6 +69,9 @@ data TestCompilerArgs = TestCompilerArgs{
, unregisterised :: Bool
, tables_next_to_code :: Bool
, targetWithSMP :: Bool -- does the target support SMP
+ , debugged :: Bool
+ -- ^ Whether the compiler has the debug RTS,
+ -- corresponding to the -debug option.
, debugAssertions :: Bool
-- ^ Whether the compiler has debug assertions enabled,
-- corresponding to the -DDEBUG option.
@@ -104,6 +107,7 @@ inTreeCompilerArgs stg = do
let ghcStage = succStage stg
debugAssertions <- ghcDebugAssertions <$> flavour <*> pure ghcStage
+ debugged <- ghcDebugged <$> flavour <*> pure ghcStage
profiled <- ghcProfiled <$> flavour <*> pure ghcStage
os <- setting HostOs
@@ -149,12 +153,14 @@ outOfTreeCompilerArgs = do
unregisterised <- getBooleanSetting TestGhcUnregisterised
tables_next_to_code <- getBooleanSetting TestGhcTablesNextToCode
targetWithSMP <- targetSupportsSMP
- debugAssertions <- getBooleanSetting TestGhcDebugged
+ debugAssertions <- getBooleanSetting TestGhcDebugAssertions
os <- getTestSetting TestHostOS
arch <- getTestSetting TestTargetARCH_CPP
platform <- getTestSetting TestTARGETPLATFORM
wordsize <- getTestSetting TestWORDSIZE
+ rtsWay <- getTestSetting TestRTSWay
+ let debugged = "debug" `isInfixOf` rtsWay
llc_cmd <- getTestSetting TestLLC
have_llvm <- liftIO (isJust <$> findExecutable llc_cmd)
@@ -243,6 +249,7 @@ runTestBuilderArgs = builder Testsuite ? do
, arg "-e", arg $ "config.accept_os=" ++ show acceptOS
, arg "-e", arg $ "config.exeext=" ++ quote (if null exe then "" else "."<>exe)
, arg "-e", arg $ "config.compiler_debugged=" ++ show debugAssertions
+ , arg "-e", arg $ "config.debug_rts=" ++ show debugged
-- MP: TODO, we do not need both, they get aliased to the same thing.
, arg "-e", arg $ asBool "ghc_with_native_codegen=" withNativeCodeGen
diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py
index 732b71b1ad..3984291ff8 100644
--- a/testsuite/driver/testglobals.py
+++ b/testsuite/driver/testglobals.py
@@ -64,6 +64,9 @@ class TestConfig:
# Was the compiler compiled with DEBUG?
self.compiler_debugged = False
+ # Was the compiler compiled with -debug?
+ self.debug_rts = False
+
# Was the compiler compiled with LLVM?
self.ghc_built_by_llvm = False
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index f79be903a5..6fa0a58455 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -681,6 +681,9 @@ def compiler_profiled( ) -> bool:
def compiler_debugged( ) -> bool:
return config.compiler_debugged
+def debug_rts( ) -> bool:
+ return config.debug_rts
+
def have_gdb( ) -> bool:
return config.have_gdb
diff --git a/testsuite/ghc-config/ghc-config.hs b/testsuite/ghc-config/ghc-config.hs
index b308cf61d5..b792643dbb 100644
--- a/testsuite/ghc-config/ghc-config.hs
+++ b/testsuite/ghc-config/ghc-config.hs
@@ -13,12 +13,13 @@ main = do
getGhcFieldOrFail fields "TARGETPLATFORM" "Target platform"
getGhcFieldOrFail fields "TargetOS_CPP" "Target OS"
getGhcFieldOrFail fields "TargetARCH_CPP" "Target architecture"
+ getGhcFieldOrFail fields "RTSWay" "RTS way"
info <- readProcess ghc ["--info"] ""
let fields = read info :: [(String,String)]
getGhcFieldOrFail fields "GhcStage" "Stage"
- getGhcFieldOrFail fields "GhcDebugged" "Debug on"
+ getGhcFieldOrFail fields "GhcDebugAssertions" "Debug on"
getGhcFieldOrFail fields "GhcWithNativeCodeGen" "Have native code generator"
getGhcFieldOrFail fields "GhcWithInterpreter" "Have interpreter"
getGhcFieldOrFail fields "GhcWithRtsLinker" "target has RTS linker"
diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk
index 7c654df9ae..bb5d138856 100644
--- a/testsuite/mk/test.mk
+++ b/testsuite/mk/test.mk
@@ -78,7 +78,7 @@ endif
RUNTEST_OPTS += -e "ghc_compiler_always_flags='$(TEST_HC_OPTS)'"
-ifeq "$(GhcDebugged)" "YES"
+ifeq "$(GhcDebugAssertions)" "YES"
RUNTEST_OPTS += -e "config.compiler_debugged=True"
else
RUNTEST_OPTS += -e "config.compiler_debugged=False"