testsuite: Add test for #11076
authorBen Gamari <ben@smart-cactus.org>
Mon, 6 Mar 2017 20:54:20 +0000 (15:54 -0500)
committerBen Gamari <ben@smart-cactus.org>
Mon, 6 Mar 2017 22:23:02 +0000 (17:23 -0500)
testsuite/tests/stranal/should_run/T13380.hs [new file with mode: 0644]
testsuite/tests/stranal/should_run/all.T

diff --git a/testsuite/tests/stranal/should_run/T13380.hs b/testsuite/tests/stranal/should_run/T13380.hs
new file mode 100644 (file)
index 0000000..4a012bf
--- /dev/null
@@ -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
index d3d4aaf..0764746 100644 (file)
@@ -14,3 +14,4 @@ test('T11076', normal, multimod_compile_and_run, ['T11076.hs', 'T11076_prim.cmm'
 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, [''])