Fold ghc-prim.git into ghc.git (re #8545)
[ghc.git] / testsuite / tests / plugins / LinkerTicklingPlugin.hs
1 module LinkerTicklingPlugin where
2
3 import GhcPlugins
4 import StaticFlags
5
6 plugin :: Plugin
7 plugin = defaultPlugin {
8 installCoreToDos = install
9 }
10
11 -- This tests whether plugins are linking against the *running* GHC
12 -- or a new instance of it. If it is a new instance the staticFlags
13 -- won't have been initialised, so we'll get a GHC panic here:
14 install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
15 install _options todos = reinitializeGlobals >> (length staticFlags `seq` return todos)
16 --- XXX: remove reinitializeGlobals when we have fixed the linker
17 -- problem (see comment with reinitializeGlobals in CoreMonad.hs)