summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2019-01-31 18:00:35 +0100
committerSebastian Graf <sebastian.graf@kit.edu>2019-01-31 18:00:35 +0100
commite9c6424275946d6373c65c28309f51ac72b9bbc8 (patch)
tree89f7c10e83e471293da588ce1d5899febae20a93
parent8cc62c3bee1155a767448488964dd18680343fa8 (diff)
downloadhaskell-e9c6424275946d6373c65c28309f51ac72b9bbc8.tar.gz
Add regression test for #14171
-rw-r--r--testsuite/tests/stranal/should_run/T14171.hs16
-rw-r--r--testsuite/tests/stranal/should_run/all.T1
2 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_run/T14171.hs b/testsuite/tests/stranal/should_run/T14171.hs
new file mode 100644
index 0000000000..edee0830d9
--- /dev/null
+++ b/testsuite/tests/stranal/should_run/T14171.hs
@@ -0,0 +1,16 @@
+module Main where
+
+import Control.Concurrent.STM
+import Control.Concurrent.STM.TVar
+
+chkLoop :: TVar String -> STM ()
+chkLoop v = do
+ val <- readTVar v
+ if (length val == 2) then retry else return ()
+
+main :: IO ()
+main = do
+ v <- newTVarIO "hi"
+ atomically $ do
+ chkLoop v `orElse` return ()
+ error "you're expected to see this"
diff --git a/testsuite/tests/stranal/should_run/all.T b/testsuite/tests/stranal/should_run/all.T
index f33adac932..278b91b292 100644
--- a/testsuite/tests/stranal/should_run/all.T
+++ b/testsuite/tests/stranal/should_run/all.T
@@ -20,5 +20,6 @@ test('T11555a', normal, compile_and_run, [''])
test('T12368', exit_code(1), compile_and_run, [''])
test('T12368a', exit_code(1), compile_and_run, [''])
test('T13380', [expect_broken(13380), exit_code(1)], compile_and_run, [''])
+test('T14171', [expect_broken(14171), exit_code(1)], compile_and_run, [''])
test('T14290', normal, compile_and_run, [''])
test('T14285', normal, multimod_compile_and_run, ['T14285', ''])