diff options
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/primops/should_run/T14664.hs | 17 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/T14664.stdout | 3 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/all.T | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/primops/should_run/T14664.hs b/testsuite/tests/primops/should_run/T14664.hs new file mode 100644 index 0000000000..4c29d327d0 --- /dev/null +++ b/testsuite/tests/primops/should_run/T14664.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE MagicHash #-} + +module Main where + +import GHC.Exts +import Control.Exception + +main :: IO () +main = do + + let + printE :: ArithException -> IO () + printE = print + + catch (raiseUnderflow# void#) printE + catch (raiseOverflow# void#) printE + catch (raiseDivZero# void#) printE diff --git a/testsuite/tests/primops/should_run/T14664.stdout b/testsuite/tests/primops/should_run/T14664.stdout new file mode 100644 index 0000000000..35e798039c --- /dev/null +++ b/testsuite/tests/primops/should_run/T14664.stdout @@ -0,0 +1,3 @@ +arithmetic underflow +arithmetic overflow +divide by zero diff --git a/testsuite/tests/primops/should_run/all.T b/testsuite/tests/primops/should_run/all.T index bbcbdd8f78..16579207fa 100644 --- a/testsuite/tests/primops/should_run/all.T +++ b/testsuite/tests/primops/should_run/all.T @@ -28,3 +28,4 @@ test('CmpInt16', normal, compile_and_run, ['']) test('CmpWord16', normal, compile_and_run, ['']) test('ShrinkSmallMutableArrayA', normal, compile_and_run, ['']) test('ShrinkSmallMutableArrayB', normal, compile_and_run, ['']) +test('T14664', normal, compile_and_run, ['']) |