diff options
Diffstat (limited to 'testsuite/tests/concurrent')
-rw-r--r-- | testsuite/tests/concurrent/should_run/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/concurrent/should_run/tryAtomicReadMVar1.hs | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/concurrent/should_run/all.T b/testsuite/tests/concurrent/should_run/all.T index 5665764fbc..1b729fac8f 100644 --- a/testsuite/tests/concurrent/should_run/all.T +++ b/testsuite/tests/concurrent/should_run/all.T @@ -77,6 +77,7 @@ test('T5866', exit_code(1), compile_and_run, ['']) test('atomicReadMVar1', normal, compile_and_run, ['']) test('atomicReadMVar2', normal, compile_and_run, ['']) test('atomicReadMVar3', normal, compile_and_run, ['']) +test('tryAtomicReadMVar1', normal, compile_and_run, ['']) # ----------------------------------------------------------------------------- # These tests we only do for a full run diff --git a/testsuite/tests/concurrent/should_run/tryAtomicReadMVar1.hs b/testsuite/tests/concurrent/should_run/tryAtomicReadMVar1.hs new file mode 100644 index 0000000000..387dde3dd0 --- /dev/null +++ b/testsuite/tests/concurrent/should_run/tryAtomicReadMVar1.hs @@ -0,0 +1,11 @@ +module Main where + +import GHC.MVar +import Control.Concurrent + +main = do + m <- newMVar (0 :: Int) + Just 0 <- tryAtomicReadMVar m + takeMVar m + Nothing <- tryAtomicReadMVar m + return () |