From: simonmar Date: Tue, 1 May 2001 11:06:19 +0000 (+0000) Subject: [project @ 2001-05-01 11:06:19 by simonmar] X-Git-Tag: Approximately_9120_patches~2043 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=598998ebcf70043f843d2b6a97c64ab3be40da0a;p=ghc-hetmet.git [project @ 2001-05-01 11:06:19 by simonmar] Tests for BlockedOnDeadMVar and ThreadKilled exceptions (they generate no output by default in forked threads). --- diff --git a/ghc/tests/concurrent/should_run/conc029.hs b/ghc/tests/concurrent/should_run/conc029.hs new file mode 100644 index 0000000..b0fab12 --- /dev/null +++ b/ghc/tests/concurrent/should_run/conc029.hs @@ -0,0 +1,11 @@ +module Main where + +import Exception +import Concurrent +import Prelude hiding (catch) + +-- the BlockOnDeadMVar exception doesn't cause any output by default + +main = do + forkIO (do m <- newEmptyMVar; takeMVar m) + print (sum [1..10000]) diff --git a/ghc/tests/concurrent/should_run/conc029.stdout b/ghc/tests/concurrent/should_run/conc029.stdout new file mode 100644 index 0000000..b9d5693 --- /dev/null +++ b/ghc/tests/concurrent/should_run/conc029.stdout @@ -0,0 +1 @@ +50005000 diff --git a/ghc/tests/concurrent/should_run/conc030.hs b/ghc/tests/concurrent/should_run/conc030.hs new file mode 100644 index 0000000..1e56632 --- /dev/null +++ b/ghc/tests/concurrent/should_run/conc030.hs @@ -0,0 +1,15 @@ +module Main where + +import Exception +import Concurrent +import Prelude hiding (catch) + +-- the ThreadKilled exception doesn't cause any output by default + +main = do + m <- newEmptyMVar + id <- forkIO (takeMVar m) + yield + killThread id + putMVar m () + print (sum [1..50000]) diff --git a/ghc/tests/concurrent/should_run/conc030.stdout b/ghc/tests/concurrent/should_run/conc030.stdout new file mode 100644 index 0000000..ba6ee95 --- /dev/null +++ b/ghc/tests/concurrent/should_run/conc030.stdout @@ -0,0 +1 @@ +1250025000