[project @ 2001-05-01 11:06:19 by simonmar]
authorsimonmar <unknown>
Tue, 1 May 2001 11:06:19 +0000 (11:06 +0000)
committersimonmar <unknown>
Tue, 1 May 2001 11:06:19 +0000 (11:06 +0000)
Tests for BlockedOnDeadMVar and ThreadKilled exceptions (they generate
no output by default in forked threads).

ghc/tests/concurrent/should_run/conc029.hs [new file with mode: 0644]
ghc/tests/concurrent/should_run/conc029.stdout [new file with mode: 0644]
ghc/tests/concurrent/should_run/conc030.hs [new file with mode: 0644]
ghc/tests/concurrent/should_run/conc030.stdout [new file with mode: 0644]

diff --git a/ghc/tests/concurrent/should_run/conc029.hs b/ghc/tests/concurrent/should_run/conc029.hs
new file mode 100644 (file)
index 0000000..b0fab12
--- /dev/null
@@ -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 (file)
index 0000000..b9d5693
--- /dev/null
@@ -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 (file)
index 0000000..1e56632
--- /dev/null
@@ -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 (file)
index 0000000..ba6ee95
--- /dev/null
@@ -0,0 +1 @@
+1250025000