summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/should_run/T13380.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-03-06 15:54:20 -0500
committerBen Gamari <ben@smart-cactus.org>2017-03-06 17:23:02 -0500
commit494907f89d129370ec5ab178cec860a64b456ac8 (patch)
tree343e4e5998ae041e3212a3eaee91ebf2fe91a530 /testsuite/tests/stranal/should_run/T13380.hs
parent18312086a48c90b22583c81fdb7bd2d7bfd38991 (diff)
downloadhaskell-494907f89d129370ec5ab178cec860a64b456ac8.tar.gz
testsuite: Add test for #11076
Diffstat (limited to 'testsuite/tests/stranal/should_run/T13380.hs')
-rw-r--r--testsuite/tests/stranal/should_run/T13380.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_run/T13380.hs b/testsuite/tests/stranal/should_run/T13380.hs
new file mode 100644
index 0000000000..4a012bf436
--- /dev/null
+++ b/testsuite/tests/stranal/should_run/T13380.hs
@@ -0,0 +1,10 @@
+import Control.Exception
+
+-- This should result in the "What" exception, not the undefined.
+{-# NOINLINE f #-}
+f :: Int -> Int -> IO Int
+f x y | x>0 = throwIO (userError "What")
+ | y>0 = return 1
+ | otherwise = return 2
+
+main = f 2 undefined >>= print