summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/allocLimit3.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/concurrent/should_run/allocLimit3.hs')
-rw-r--r--testsuite/tests/concurrent/should_run/allocLimit3.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/concurrent/should_run/allocLimit3.hs b/testsuite/tests/concurrent/should_run/allocLimit3.hs
new file mode 100644
index 0000000000..28881dc016
--- /dev/null
+++ b/testsuite/tests/concurrent/should_run/allocLimit3.hs
@@ -0,0 +1,15 @@
+module Main (main) where
+
+import GHC.Conc
+import Control.Concurrent
+import Control.Exception
+
+main = do
+ setAllocationCounter (10*1024)
+ enableAllocationLimit
+
+ -- alloc limit overflow while masked: should successfully print the
+ -- result, and then immediately raise the exception
+ r <- mask_ $ try $ print (length [1..100000])
+
+ print (r :: Either SomeException ())