summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichalis Pardalos <m.pardalos@gmail.com>2020-07-17 13:23:34 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-27 20:09:44 -0400
commit6da73bbf97cca8bd64d70a26298e7f7ddad2ce52 (patch)
tree5f17500be0b339fac1aa62198d11a434cab1f627
parentaa054d32a8ff69c334293a0d6c9d11b83a236a96 (diff)
downloadhaskell-6da73bbf97cca8bd64d70a26298e7f7ddad2ce52.tar.gz
Add minimal test for #12492
-rw-r--r--testsuite/tests/primops/should_run/T12492.hs11
-rw-r--r--testsuite/tests/primops/should_run/all.T1
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, [''])