[project @ 1999-06-14 11:17:12 by simonmar]
[ghc-hetmet.git] / ghc / tests / concurrent / should_run / conc012.hs
index e9dd408..0030742 100644 (file)
@@ -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)))