summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Barton <rwbarton@gmail.com>2015-07-31 17:09:45 -0400
committerReid Barton <rwbarton@gmail.com>2015-07-31 17:09:46 -0400
commitad089f58be522cb68c0306c21c5df9d72b6c0aff (patch)
treeb02d2f64e437b7ad932b55dac9426b208ca07c73
parent8f81af9a133d443720f597ba81ac5a2c5fcc2c3d (diff)
downloadhaskell-ad089f58be522cb68c0306c21c5df9d72b6c0aff.tar.gz
Give raise# a return type of open kind (#10481)
Test Plan: validate Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1116 GHC Trac Issues: #10481
-rw-r--r--compiler/prelude/primops.txt.pp3
-rw-r--r--testsuite/.gitignore1
-rw-r--r--testsuite/tests/primops/should_run/T10481.hs9
-rw-r--r--testsuite/tests/primops/should_run/T10481.stderr1
-rw-r--r--testsuite/tests/primops/should_run/all.T1
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, [''])