Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / simplCore / should_run / T3437.hs
1 {-# LANGUAGE BangPatterns #-}
2 {-# OPTIONS_GHC -O2 #-}
3
4 -- #3437
5 -- When we do SpecConstr on 'go', we want the specialised
6 -- function to *still* be strict in k. Otherwise we get
7 -- a bad space leak!
8
9 -- The test is run with +RTS -M10m to limit the amount of heap
10 -- It should run in constant space, but if the function isn't
11 -- strict enough it'll run out of heap
12
13 module Main where
14
15 go :: [Int] -> [Int] -> [Int]
16 go (0:xs) !k = k
17 go (n:xs) !k = go (n-1 : xs) (k ++ k)
18
19 main = print (go [100000000] [])