From ad089f58be522cb68c0306c21c5df9d72b6c0aff Mon Sep 17 00:00:00 2001 From: Reid Barton Date: Fri, 31 Jul 2015 17:09:45 -0400 Subject: 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 --- testsuite/tests/primops/should_run/T10481.hs | 9 +++++++++ testsuite/tests/primops/should_run/T10481.stderr | 1 + testsuite/tests/primops/should_run/all.T | 1 + 3 files changed, 11 insertions(+) create mode 100644 testsuite/tests/primops/should_run/T10481.hs create mode 100644 testsuite/tests/primops/should_run/T10481.stderr (limited to 'testsuite/tests/primops') 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, ['']) -- cgit v1.2.1