diff options
-rw-r--r-- | testsuite/tests/primops/should_run/T12492.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/all.T | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/primops/should_run/T12492.hs b/testsuite/tests/primops/should_run/T12492.hs new file mode 100644 index 0000000000..f232ad7f15 --- /dev/null +++ b/testsuite/tests/primops/should_run/T12492.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} + +import GHC.Exts +import GHC.IO + +main :: IO () +main = IO $ \s -> case newByteArray# 1032161# s of + (# s', mba# #) -> case unpackClosure# (unsafeCoerce# mba# :: Any) of + (# !_, _, _ #) -> (# s', () #) diff --git a/testsuite/tests/primops/should_run/all.T b/testsuite/tests/primops/should_run/all.T index 952145fd49..b9e447bb1e 100644 --- a/testsuite/tests/primops/should_run/all.T +++ b/testsuite/tests/primops/should_run/all.T @@ -19,6 +19,7 @@ test('ArithWord8', omit_ways(['ghci']), compile_and_run, ['']) test('CmpInt8', normal, compile_and_run, ['']) test('CmpWord8', normal, compile_and_run, ['']) test('ShowPrim', normal, compile_and_run, ['']) +test('T12492', normal, compile_and_run, ['']) # These two tests use unboxed tuples, which GHCi doesn't support test('ArithInt16', omit_ways(['ghci']), compile_and_run, ['']) |