Commit 337ccb6a authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #3437

parent 35c85b33
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -O2 #-}
-- Trac #3437
-- When we do SpecConstr on 'go', we want the specialised
-- function to *still* be strict in k. Otherwise we get
-- a bad space leak!
-- The test is run with +RTS -M10m to limit the amount of heap
-- It should run in constant space, but if the function isn't
-- strict enough it'll run out of heap
module Main where
go :: [Int] -> [Int] -> [Int]
go (0:xs) !k = k
go (n:xs) !k = go (n-1 : xs) (k ++ k)
main = print (go [100000000] [])
......@@ -27,5 +27,6 @@ test('simplrun010', composes([extra_run_opts('24 16 8'),
# the output of -ddump-rules can be compared
test('T2486', normal, compile, [''])
test('T2756', normal, compile_and_run, [''])
test('T3437', extra_run_opts('+RTS -M10m'), compile_and_run, [''])
test('SeqRule', only_ways(['optc','optasm']), compile_and_run, [''])
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