From: simonmar Date: Mon, 14 Jun 1999 11:17:12 +0000 (+0000) Subject: [project @ 1999-06-14 11:17:12 by simonmar] X-Git-Tag: Approximately_9120_patches~6124 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=7b4235e8c3c1c15c03c35c53e9a790626f4e27d8;p=ghc-hetmet.git [project @ 1999-06-14 11:17:12 by simonmar] Don't rely on bad implementation of 'sum', now that we don't have one :) --- diff --git a/ghc/tests/concurrent/should_run/conc012.hs b/ghc/tests/concurrent/should_run/conc012.hs index e9dd408..0030742 100644 --- a/ghc/tests/concurrent/should_run/conc012.hs +++ b/ghc/tests/concurrent/should_run/conc012.hs @@ -2,13 +2,18 @@ module Main where import Concurrent import Exception +import GlaExts data Result = Died Exception | Finished -- Test stack overflow catching. Should print "Died: stack overflow". +stackoverflow :: Int -> Int +stackoverflow 0 = 1 +stackoverflow n = n + stackoverflow n + main = do - let x = sum [1..100000] -- relies on sum being implemented badly :-) + let x = stackoverflow 1 result <- newEmptyMVar forkIO (catchAllIO (x `seq` putMVar result Finished) (\e -> putMVar result (Died e)))