Ticket #9003: wrongeventlog.hs

File wrongeventlog.hs, 576 bytes (added by jberthold, 3 years ago)

Test program

Line 
1-- wrongeventlog: produces different logs depending on GHC version
2
3module Main where
4
5import Control.Concurrent
6import Debug.Trace
7import GHC.Conc
8
9main = do 
10  -- define some time-consuming computation
11  let stuff = ack 3 10
12  -- create a thread which blackholes something
13  traceEventIO "forking child thread"
14  forkIO (do traceEventIO "child"
15             putStrLn ("child thread sez " ++ show stuff))
16  yield
17  putStrLn ("and the main thread sez " ++ show stuff)
18
19ack :: Integer -> Integer -> Integer
20ack 0 m = m+1
21ack n 0 = ack (n-1) 1
22ack n m = ack (n-1) (ack n (m-1))