diff options
author | Max Bolingbroke <batterseapower@hotmail.com> | 2011-06-30 11:35:46 +0100 |
---|---|---|
committer | Max Bolingbroke <batterseapower@hotmail.com> | 2011-06-30 11:35:46 +0100 |
commit | 7d672220abe43ee8e4688e8babbc1c70ba6bfe88 (patch) | |
tree | a9364525ff89f336bf6eda6bac119e2824c7b2de | |
parent | 08b9bccd5254c191ef6b3ade61c94f4e0b696d99 (diff) | |
download | haskell-7d672220abe43ee8e4688e8babbc1c70ba6bfe88.tar.gz |
Add expected-fail test showing plugin linking is faulty
4 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/plugins/LinkerTicklingPlugin.hs b/testsuite/tests/ghc-regress/plugins/LinkerTicklingPlugin.hs new file mode 100644 index 0000000000..52d5e177bb --- /dev/null +++ b/testsuite/tests/ghc-regress/plugins/LinkerTicklingPlugin.hs @@ -0,0 +1,15 @@ +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 diff --git a/testsuite/tests/ghc-regress/plugins/all.T b/testsuite/tests/ghc-regress/plugins/all.T index 41435d120b..b9d4e4497d 100644 --- a/testsuite/tests/ghc-regress/plugins/all.T +++ b/testsuite/tests/ghc-regress/plugins/all.T @@ -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('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 != '': runCmd('$MAKE -C ' + in_testdir('') + ' clean') diff --git a/testsuite/tests/ghc-regress/plugins/plugins06.hs b/testsuite/tests/ghc-regress/plugins/plugins06.hs new file mode 100644 index 0000000000..ad80d2c636 --- /dev/null +++ b/testsuite/tests/ghc-regress/plugins/plugins06.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_GHC -fplugin LinkerTicklingPlugin #-} + +module Main where + +main :: IO () +main = return () diff --git a/testsuite/tests/ghc-regress/plugins/plugins06.stdout b/testsuite/tests/ghc-regress/plugins/plugins06.stdout new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/testsuite/tests/ghc-regress/plugins/plugins06.stdout |