diff options
-rw-r--r-- | compiler/prelude/primops.txt.pp | 3 | ||||
-rw-r--r-- | testsuite/.gitignore | 1 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/T10481.hs | 9 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/T10481.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/all.T | 1 |
5 files changed, 14 insertions, 1 deletions
diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 9b107f2053..6d45ed9bc7 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -1960,7 +1960,8 @@ primop CatchOp "catch#" GenPrimOp has_side_effects = True primop RaiseOp "raise#" GenPrimOp - a -> b + b -> o + -- NB: the type variable "o" is "a", but with OpenKind with strictness = { \ _arity -> mkClosedStrictSig [topDmd] botRes } -- NB: result is bottom diff --git a/testsuite/.gitignore b/testsuite/.gitignore index 6ebb05a90e..c92ce717a1 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -1221,6 +1221,7 @@ mk/ghcconfig*_bin_ghc-*.exe.mk /tests/polykinds/PolyKinds10 /tests/primops/should_run/T6135 /tests/primops/should_run/T7689 +/tests/primops/should_run/T10481 /tests/profiling/should_compile/prof001 /tests/profiling/should_compile/prof002 /tests/profiling/should_run/2592 diff --git a/testsuite/tests/primops/should_run/T10481.hs b/testsuite/tests/primops/should_run/T10481.hs new file mode 100644 index 0000000000..bfdb35626e --- /dev/null +++ b/testsuite/tests/primops/should_run/T10481.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE MagicHash #-} + +import GHC.Exts +import Control.Exception + +f :: ArithException -> Int# +f x = raise# (toException x) + +main = print (I# (f Overflow)) diff --git a/testsuite/tests/primops/should_run/T10481.stderr b/testsuite/tests/primops/should_run/T10481.stderr new file mode 100644 index 0000000000..228377ee73 --- /dev/null +++ b/testsuite/tests/primops/should_run/T10481.stderr @@ -0,0 +1 @@ +T10481: arithmetic overflow diff --git a/testsuite/tests/primops/should_run/all.T b/testsuite/tests/primops/should_run/all.T index 12f94913d3..b21279aa99 100644 --- a/testsuite/tests/primops/should_run/all.T +++ b/testsuite/tests/primops/should_run/all.T @@ -2,3 +2,4 @@ test('T6135', normal, compile_and_run, ['']) test('T7689', normal, compile_and_run, ['']) # The test is using unboxed tuples, so omit ghci test('T9430', omit_ways(['ghci']), compile_and_run, ['']) +test('T10481', exit_code(1), compile_and_run, ['']) |