summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDavid Feuer <david.feuer@gmail.com>2017-03-01 01:14:13 -0500
committerDavid Feuer <David.Feuer@gmail.com>2017-03-01 01:14:14 -0500
commit701256df88c61a2eee4cf00a59e61ef76a57b4b4 (patch)
tree390d51339bff6fb8d5369ec55a7d3cdc2fb5bb57 /testsuite
parentb86d226fda2f512178e04da4dec96b15c4480507 (diff)
downloadhaskell-701256df88c61a2eee4cf00a59e61ef76a57b4b4.tar.gz
Change catch# demand signature
* Give `catch#` a lazy demand signature, to make it more honest. * Make `catchException` and `catchAny` force their arguments so they actually behave as advertised. * Use `catch` rather than `catchException` in `forkIO`, `forkOn`, and `forkOS` to avoid losing exceptions. Fixes #13330 Reviewers: rwbarton, simonpj, simonmar, bgamari, hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3244
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/concurrent/should_run/T13330.hs5
-rw-r--r--testsuite/tests/concurrent/should_run/T13330.stderr3
-rw-r--r--testsuite/tests/concurrent/should_run/all.T3
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/concurrent/should_run/T13330.hs b/testsuite/tests/concurrent/should_run/T13330.hs
new file mode 100644
index 0000000000..ab8effe786
--- /dev/null
+++ b/testsuite/tests/concurrent/should_run/T13330.hs
@@ -0,0 +1,5 @@
+module Main where
+import Control.Concurrent
+import Control.Exception
+
+main = forkIO (error "Successful exception") >> threadDelay 100000
diff --git a/testsuite/tests/concurrent/should_run/T13330.stderr b/testsuite/tests/concurrent/should_run/T13330.stderr
new file mode 100644
index 0000000000..9eecb64567
--- /dev/null
+++ b/testsuite/tests/concurrent/should_run/T13330.stderr
@@ -0,0 +1,3 @@
+T13330: Successful exception
+CallStack (from HasCallStack):
+ error, called at T13330.hs:5:16 in main:Main
diff --git a/testsuite/tests/concurrent/should_run/all.T b/testsuite/tests/concurrent/should_run/all.T
index 87af525e9f..16363ed0b8 100644
--- a/testsuite/tests/concurrent/should_run/all.T
+++ b/testsuite/tests/concurrent/should_run/all.T
@@ -280,3 +280,6 @@ test('hs_try_putmvar003',
],
compile_and_run,
['hs_try_putmvar003_c.c'])
+
+# Check forkIO exception determinism under optimization
+test('T13330', normal, compile_and_run, ['-O'])