[commit: testsuite] master: test for #5421 (ce693f6)

Simon Marlow marlowsd at gmail.com
Mon Nov 7 11:08:36 CET 2011


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/ce693f6128bfe3d2950f0d57288dba6db50c661e

>---------------------------------------------------------------

commit ce693f6128bfe3d2950f0d57288dba6db50c661e
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Fri Nov 4 16:20:11 2011 +0000

    test for #5421

>---------------------------------------------------------------

 tests/concurrent/should_run/5421.hs |   17 +++++++++++++++++
 tests/concurrent/should_run/all.T   |    3 +++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/tests/concurrent/should_run/5421.hs b/tests/concurrent/should_run/5421.hs
new file mode 100644
index 0000000..863820b
--- /dev/null
+++ b/tests/concurrent/should_run/5421.hs
@@ -0,0 +1,17 @@
+import Control.Concurrent
+import Control.Monad.Fix
+
+data Client = Client
+	{ clientLock :: MVar ()
+	}
+
+main = do
+	mvar <- newMVar ()
+	
+	client <- mfix $ \client -> do
+		_ <- forkIO (mainLoop client)
+                threadDelay 200000
+		return (Client mvar)
+	return ()
+
+mainLoop client = withMVar (clientLock client) (\_ -> return ())
diff --git a/tests/concurrent/should_run/all.T b/tests/concurrent/should_run/all.T
index 6779458..7c93439 100644
--- a/tests/concurrent/should_run/all.T
+++ b/tests/concurrent/should_run/all.T
@@ -65,6 +65,8 @@ test('5558',
        cmd_wrapper(lambda c: 'for i in `seq 1 100`; do ' + c + ' || break; done') ],
      compile_and_run, [''])
 
+test('5421', normal, compile_and_run, [''])
+
 # -----------------------------------------------------------------------------
 # These tests we only do for a full run
 
@@ -205,3 +207,4 @@ test('conc067', ignore_output, compile_and_run, [''])
 # omit threaded2, the behaviour of this test is non-deterministic with more
 # than one CPU.
 test('conc068', [ omit_ways('threaded2'), exit_code(1) ], compile_and_run, [''])
+





More information about the Cvs-ghc mailing list