From 7b4235e8c3c1c15c03c35c53e9a790626f4e27d8 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 14 Jun 1999 11:17:12 +0000 Subject: [PATCH] [project @ 1999-06-14 11:17:12 by simonmar] Don't rely on bad implementation of 'sum', now that we don't have one :) --- ghc/tests/concurrent/should_run/conc012.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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))) -- 1.7.10.4