diff options
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/plugins/LinkerTicklingPlugin.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/plugins/all.T | 2 |
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/']), |