summaryrefslogtreecommitdiff
path: root/testsuite/tests/primops/should_run/UnliftedTVar2.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/primops/should_run/UnliftedTVar2.hs')
-rw-r--r--testsuite/tests/primops/should_run/UnliftedTVar2.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/testsuite/tests/primops/should_run/UnliftedTVar2.hs b/testsuite/tests/primops/should_run/UnliftedTVar2.hs
index 70cbce18a8..5e87007e2b 100644
--- a/testsuite/tests/primops/should_run/UnliftedTVar2.hs
+++ b/testsuite/tests/primops/should_run/UnliftedTVar2.hs
@@ -7,6 +7,7 @@
module Main where
+import Control.Monad
import Data.Kind
import GHC.Exts
import GHC.IO
@@ -28,7 +29,12 @@ main = do
case readTVarIO# tvar s4 of
(# s5, U res #) ->
(# s5, ( I# r, I# res ) #)
- print (x == y, x > 100000)
+ unless (x > 100000) $ do
+ print (x,y)
+ fail "not enough iterations"
+ unless (x <= y) $ do
+ print (x,y)
+ fail "mismatch"
increment :: TVar# RealWorld U -> State# RealWorld -> (# State# RealWorld, Int #)
increment tvar = go