summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-09-24 16:10:16 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-30 02:49:41 -0400
commitdf3f58807580bc2762086e063e3823b05de6fd64 (patch)
tree1c59f841d9eb351c20b1abe76e7db82634cc8056 /testsuite/tests
parent6527fc57b8e099703f5bdb5ec7f1dfd421651972 (diff)
downloadhaskell-df3f58807580bc2762086e063e3823b05de6fd64.tar.gz
Remove unsafeGlobalDynFlags (#17957, #14597)
There are still global variables but only 3 booleans instead of a single DynFlags.
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/plugins/LinkerTicklingPlugin.hs13
-rw-r--r--testsuite/tests/plugins/all.T2
2 files changed, 10 insertions, 5 deletions
diff --git a/testsuite/tests/plugins/LinkerTicklingPlugin.hs b/testsuite/tests/plugins/LinkerTicklingPlugin.hs
index 7b7fc12a62..34ff7e3c64 100644
--- a/testsuite/tests/plugins/LinkerTicklingPlugin.hs
+++ b/testsuite/tests/plugins/LinkerTicklingPlugin.hs
@@ -2,14 +2,19 @@ module LinkerTicklingPlugin where
import GHC.Plugins
import GHC.Driver.Session
+import GHC.Utils.GlobalVars
plugin :: Plugin
-plugin = defaultPlugin {
- installCoreToDos = install
- }
+plugin = defaultPlugin
+ { installCoreToDos = install
+ }
-- This tests whether plugins are linking against the *running* GHC or a new
-- instance of it. If it is a new instance (settings unsafeGlobalDynFlags) won't
-- have been initialised, so we'll get a GHC panic here:
install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
-install _options todos = settings unsafeGlobalDynFlags `seq` return todos
+install _options todos = io `seq` return todos
+ where
+ io = if not unsafeHasPprDebug
+ then error "unsafePprDebug should be set: plugin linked against a different GHC?"
+ else ()
diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T
index 891246b228..e02681d7c0 100644
--- a/testsuite/tests/plugins/all.T
+++ b/testsuite/tests/plugins/all.T
@@ -44,7 +44,7 @@ test('plugins06',
[extra_files(['LinkerTicklingPlugin.hs']),
unless(have_dynamic(), skip),
only_ways([config.ghc_plugin_way])],
- multimod_compile_and_run, ['plugins06', '-package ghc'])
+ multimod_compile_and_run, ['plugins06', '-package ghc -dppr-debug'])
test('plugins07',
[extra_files(['rule-defining-plugin/']),