From 598998ebcf70043f843d2b6a97c64ab3be40da0a Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 1 May 2001 11:06:19 +0000 Subject: [PATCH] [project @ 2001-05-01 11:06:19 by simonmar] Tests for BlockedOnDeadMVar and ThreadKilled exceptions (they generate no output by default in forked threads). --- ghc/tests/concurrent/should_run/conc029.hs | 11 +++++++++++ ghc/tests/concurrent/should_run/conc029.stdout | 1 + ghc/tests/concurrent/should_run/conc030.hs | 15 +++++++++++++++ ghc/tests/concurrent/should_run/conc030.stdout | 1 + 4 files changed, 28 insertions(+) create mode 100644 ghc/tests/concurrent/should_run/conc029.hs create mode 100644 ghc/tests/concurrent/should_run/conc029.stdout create mode 100644 ghc/tests/concurrent/should_run/conc030.hs create mode 100644 ghc/tests/concurrent/should_run/conc030.stdout 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 -- 1.7.10.4