[project @ 1999-06-14 11:17:12 by simonmar]
authorsimonmar <unknown>
Mon, 14 Jun 1999 11:17:12 +0000 (11:17 +0000)
committersimonmar <unknown>
Mon, 14 Jun 1999 11:17:12 +0000 (11:17 +0000)
Don't rely on bad implementation of 'sum', now that we don't have one
:)

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)))