Commit 7d672220 authored by batterseapower's avatar batterseapower
Browse files

Add expected-fail test showing plugin linking is faulty

parent 08b9bccd
module LinkerTicklingPlugin where
import GhcPlugins
import StaticFlags
plugin :: Plugin
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 the staticFlags
-- won't have been initialised, so we'll get a GHC panic here:
install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
install _options todos = length staticFlags `seq` return todos
...@@ -12,5 +12,7 @@ test('plugins03', normal, compile_fail, ['-package-conf simple-plugin/local.pack ...@@ -12,5 +12,7 @@ test('plugins03', normal, compile_fail, ['-package-conf simple-plugin/local.pack
test('plugins04', extra_clean(['HomePackagePlugin.hi', 'HomePackagePlugin.o']), multimod_compile_fail, ['plugins04', '-package ghc -fplugin HomePackagePlugin']) test('plugins04', extra_clean(['HomePackagePlugin.hi', 'HomePackagePlugin.o']), multimod_compile_fail, ['plugins04', '-package ghc -fplugin HomePackagePlugin'])
test('plugins05', extra_clean(['HomePackagePlugin.hi', 'HomePackagePlugin.o']), multimod_compile_and_run, ['plugins05', '-package ghc']) test('plugins05', extra_clean(['HomePackagePlugin.hi', 'HomePackagePlugin.o']), multimod_compile_and_run, ['plugins05', '-package ghc'])
test('plugins06', compose(expect_broken(3843), extra_clean(['LinkerTicklingPlugin.hi', 'LinkerTicklingPlugin.o'])), multimod_compile_and_run, ['plugins06', '-package ghc'])
if default_testopts.cleanup != '': if default_testopts.cleanup != '':
runCmd('$MAKE -C ' + in_testdir('') + ' clean') runCmd('$MAKE -C ' + in_testdir('') + ' clean')
{-# OPTIONS_GHC -fplugin LinkerTicklingPlugin #-}
module Main where
main :: IO ()
main = return ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment