add another test for #7493
authorSimon Marlow <marlowsd@gmail.com>
Tue, 18 Dec 2012 09:29:44 +0000 (09:29 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 18 Dec 2012 09:29:44 +0000 (09:29 +0000)
tests/all.T
tests/stm065.hs [new file with mode: 0644]
tests/stm065.stdout [new file with mode: 0644]

index 375c7f6..cab1e2b 100644 (file)
@@ -39,3 +39,4 @@ test('2411', ignore_output, compile_and_run, ['-package stm'])
 test('3049', normal, compile_and_run, ['-package stm'])
 test('4057', normal, compile_and_run, ['-package stm'])
 test('stm064', normal, compile_and_run, ['-package stm'])
+test('stm065', normal, compile_and_run, ['-package stm'])
diff --git a/tests/stm065.hs b/tests/stm065.hs
new file mode 100644 (file)
index 0000000..1e16475
--- /dev/null
@@ -0,0 +1,9 @@
+import Control.Concurrent.STM
+
+main = do
+  x <- atomically $ do
+         r <- newTVar []
+         writeTVar r [2]
+         writeTVar r [] `orElse` return ()
+         readTVar r
+  print x
diff --git a/tests/stm065.stdout b/tests/stm065.stdout
new file mode 100644 (file)
index 0000000..fe51488
--- /dev/null
@@ -0,0 +1 @@
+[]