[Git][ghc/ghc][master] Add a test for #18397

Marge Bot gitlab at gitlab.haskell.org
Mon Aug 24 14:04:24 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
a77b9ec2 by Krzysztof Gogolewski at 2020-08-24T10:04:20-04:00
Add a test for #18397

The bug was fixed by !3421.

- - - - -


2 changed files:

- + testsuite/tests/codeGen/should_compile/T18397.hs
- testsuite/tests/codeGen/should_compile/all.T


Changes:

=====================================
testsuite/tests/codeGen/should_compile/T18397.hs
=====================================
@@ -0,0 +1,20 @@
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE UnboxedTuples #-}
+module T18397 where
+
+import GHC.Exts
+import GHC.ST
+
+data MutableArray s a = MutableArray (MutableArray# s a)
+
+runArray#
+  :: (forall s. ST s (MutableArray s a))
+  -> Array# a
+runArray# m = case runRW# $ \s ->
+  case unST m s of { (# s', MutableArray mary# #) ->
+  unsafeFreezeArray# mary# s'} of (# _, ary# #) -> ary#
+
+unST :: ST s a -> State# s -> (# State# s, a #)
+unST (ST f) = f
+


=====================================
testsuite/tests/codeGen/should_compile/all.T
=====================================
@@ -91,7 +91,11 @@ test('T17648', normal, makefile_test, [])
 test('T17904', normal, compile, ['-O'])
 test('T18227A', normal, compile, [''])
 test('T18227B', normal, compile, [''])
+
+# runRW#-related
 test('T18291', normal, compile, ['-O0'])
+test('T18397', normal, compile, ['-O0'])
+
 test('T15570',
    when(unregisterised(), skip),
    compile, ['-Wno-overflowed-literals'])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a77b9ec2a6153065565bca7bb154fff35b830b82

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a77b9ec2a6153065565bca7bb154fff35b830b82
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200824/abae1f6d/attachment-0001.html>


More information about the ghc-commits mailing list