Fold ghc-prim.git into ghc.git (re #8545)
[ghc.git] / testsuite / tests / perf / should_run / T5237.hs
1 {-# LANGUAGE BangPatterns #-}
2 module Main (main) where
3
4 -- Test that the rewrite rules for small exponents fire (#5237).
5 -- If they don't fire, this will allocate much.
6
7 fun :: Double -> Double
8 fun x = go 0 1.0
9 where
10 go !acc z
11 | x < z = acc
12 | otherwise = go (acc + 1/z^4) (z+1.0)
13
14 main :: IO ()
15 main = print (fun 1e7)