[Git][ghc/ghc][wip/T18227] testsuite: Add tests for #18227

Ben Gamari gitlab at gitlab.haskell.org
Wed Jun 3 05:16:13 UTC 2020



Ben Gamari pushed to branch wip/T18227 at Glasgow Haskell Compiler / GHC


Commits:
33148ef2 by Ben Gamari at 2020-06-03T01:16:04-04:00
testsuite: Add tests for #18227

T18227A is the original issue which gave rise to the ticket and depends
upon bytestring. T18227B is a minimized reproducer.

- - - - -


3 changed files:

- + testsuite/tests/codeGen/should_compile/T18227A.hs
- + testsuite/tests/codeGen/should_compile/T18227B.hs
- testsuite/tests/codeGen/should_compile/all.T


Changes:

=====================================
testsuite/tests/codeGen/should_compile/T18227A.hs
=====================================
@@ -0,0 +1,6 @@
+module T18227A (kilter) where
+import Data.ByteString.Internal
+
+kilter :: ByteString -> IO ByteString
+kilter ps@(PS x _ _) = createAndTrim 1 $ const $ pure 1
+


=====================================
testsuite/tests/codeGen/should_compile/T18227B.hs
=====================================
@@ -0,0 +1,16 @@
+-- N.B. These warnings only cause noise in stderr.
+{-# OPTIONS_GHC -Wno-overlapping-patterns -Wno-inaccessible-code #-}
+{-# LANGUAGE GADTs #-}
+
+module T18227B where
+
+import Unsafe.Coerce
+
+test1 :: UnsafeEquality Int Char -> IO ()
+test1 hi = print "hello"
+{-# NOINLINE test1 #-}
+
+test2 :: IO ()
+test2 =
+  case unsafeEqualityProof :: UnsafeEquality Int Char of
+    proof at UnsafeRefl -> test1 proof


=====================================
testsuite/tests/codeGen/should_compile/all.T
=====================================
@@ -87,3 +87,5 @@ test('T14373d', [],
 
 test('T17648', normal, makefile_test, [])
 test('T17904', normal, compile, ['-O'])
+test('T18227A', normal, compile, [''])
+test('T18227B', normal, compile, [''])



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/33148ef23d0af76a3839c886d8ad370f71f0895d
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/20200603/7bdb9540/attachment-0001.html>


More information about the ghc-commits mailing list