Commit 9e7d0dcb authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Merge branch 'master' of http://darcs.haskell.org/testsuite

parents 99da484e e36f28bd
-- The contents of this file are irrelevant. It is merely
-- the target for compilation by the T7702Plugin, which
-- exhibits the space leak in Trac #7702
module Main where
main :: IO ()
main = return ()
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
clean.%:
rm -rf pkg.$*
HERE := $(abspath .)
$(eval $(call canonicalise,HERE))
package.%:
$(MAKE) clean.$*
mkdir pkg.$*
"$(TEST_HC)" -outputdir pkg.$* --make -v0 -o pkg.$*/setup Setup.hs
echo "[]" > pkg.$*/local.package.conf
pkg.$*/setup configure --distdir pkg.$*/dist -v0 $(CABAL_PLUGIN_BUILD) --prefix="$(HERE)/pkg.$*/install" --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=pkg.$*/local.package.conf
pkg.$*/setup build --distdir pkg.$*/dist -v0
pkg.$*/setup install --distdir pkg.$*/dist -v0
import Distribution.Simple
main = defaultMain
module T7702Plugin ( plugin ) where
import GhcPlugins
-- A plugin that does nothing but tickle CoreM's writer.
plugin :: Plugin
plugin = defaultPlugin { installCoreToDos = install }
where
install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
install _ todos = do
reinitializeGlobals
putMsgS "T7702Plugin"
-- 1 million times, so the allocation in this plugin dominates allocation due
-- to other compiler flags and the test framework can easily catch the difference
-- can't use replicateM_ because it causes its own problems
nothingX100000 ; nothingX100000 ; nothingX100000 ; nothingX100000 ; nothingX100000
nothingX100000 ; nothingX100000 ; nothingX100000 ; nothingX100000 ; nothingX100000
return todos
-- this will result in a call to plusWriter in CoreM's
-- >>= implementation, which was causing the space leak
nothing :: CoreM ()
nothing = liftIO (return ())
nothingX10 :: CoreM ()
nothingX10 = do
nothing ; nothing ; nothing ; nothing ; nothing
nothing ; nothing ; nothing ; nothing ; nothing
nothingX100 :: CoreM ()
nothingX100 = do
nothingX10 ; nothingX10 ; nothingX10 ; nothingX10 ; nothingX10
nothingX10 ; nothingX10 ; nothingX10 ; nothingX10 ; nothingX10
nothingX1000 :: CoreM ()
nothingX1000 = do
nothingX100 ; nothingX100 ; nothingX100 ; nothingX100 ; nothingX100
nothingX100 ; nothingX100 ; nothingX100 ; nothingX100 ; nothingX100
nothingX10000 :: CoreM ()
nothingX10000 = do
nothingX1000 ; nothingX1000 ; nothingX1000 ; nothingX1000 ; nothingX1000
nothingX1000 ; nothingX1000 ; nothingX1000 ; nothingX1000 ; nothingX1000
nothingX100000 :: CoreM ()
nothingX100000 = do
nothingX10000 ; nothingX10000 ; nothingX10000 ; nothingX10000 ; nothingX10000
nothingX10000 ; nothingX10000 ; nothingX10000 ; nothingX10000 ; nothingX10000
Name: T7702plugin
Version: 0.1
Synopsis: Plugin which tests space leak fix in Trac #7702
Cabal-Version: >= 1.2
Build-Type: Simple
Author: Andrew Farmer
Library
Build-Depends:
base,
ghc >= 7.2.1
Exposed-Modules:
T7702Plugin
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