[commit: ghc] master: testsuite: Add test for #11076 (494907f)

git at git.haskell.org git at git.haskell.org
Mon Mar 6 22:26:38 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/494907f89d129370ec5ab178cec860a64b456ac8/ghc

>---------------------------------------------------------------

commit 494907f89d129370ec5ab178cec860a64b456ac8
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon Mar 6 15:54:20 2017 -0500

    testsuite: Add test for #11076


>---------------------------------------------------------------

494907f89d129370ec5ab178cec860a64b456ac8
 testsuite/tests/stranal/should_run/T13380.hs | 10 ++++++++++
 testsuite/tests/stranal/should_run/all.T     |  1 +
 2 files changed, 11 insertions(+)

diff --git a/testsuite/tests/stranal/should_run/T13380.hs b/testsuite/tests/stranal/should_run/T13380.hs
new file mode 100644
index 0000000..4a012bf
--- /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
diff --git a/testsuite/tests/stranal/should_run/all.T b/testsuite/tests/stranal/should_run/all.T
index d3d4aaf..0764746 100644
--- a/testsuite/tests/stranal/should_run/all.T
+++ b/testsuite/tests/stranal/should_run/all.T
@@ -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, [''])



More information about the ghc-commits mailing list