[commit: ghc] master: Add testcase for #10602 (a6359f2)

git at git.haskell.org git at git.haskell.org
Thu Jul 9 12:32:26 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a6359f2629024d67fc82a7d41c67d5d89d2d3a3d/ghc

>---------------------------------------------------------------

commit a6359f2629024d67fc82a7d41c67d5d89d2d3a3d
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Thu Jul 9 05:12:05 2015 -0400

    Add testcase for #10602


>---------------------------------------------------------------

a6359f2629024d67fc82a7d41c67d5d89d2d3a3d
 testsuite/tests/simplCore/should_compile/T10602.hs | 34 ++++++++++++++++++++++
 testsuite/tests/simplCore/should_compile/all.T     |  1 +
 2 files changed, 35 insertions(+)

diff --git a/testsuite/tests/simplCore/should_compile/T10602.hs b/testsuite/tests/simplCore/should_compile/T10602.hs
new file mode 100644
index 0000000..fc2523d
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T10602.hs
@@ -0,0 +1,34 @@
+import Control.Monad
+import Data.Binary
+import Data.List
+
+newtype A a = A [a]
+
+instance Binary a => Binary (A a) where
+    put (A xs) = case splitAt 254 xs of
+        (_, []) -> mapM_ put xs
+        (a, b)  -> put (A b)
+
+    get = do xs <- replicateM 254 get
+             A ys <- get
+             return $ A $ xs ++ ys
+
+main :: IO ()
+main = undefined
+
+{-
+This intermittently failed with although I was never able to reliably reproduce,
+
+$ ./inplace/bin/ghc-stage2 -O2 Test.hs -fforce-recomp
+[1 of 1] Compiling Main             ( Test.hs, Test.o )
+ghc-stage2: panic! (the 'impossible' happened)
+  (GHC version 7.10.1.20150708 for x86_64-unknown-linux):
+        Template variable unbound in rewrite rule
+  sg_s5zh
+  [sc_s5zf, sc_s5zg, sg_s5zh, sg_s5zi]
+  [sc_s5zf, sc_s5zg, sg_s5zh, sg_s5zi]
+  [: @ a_a3fv sc_s5zf sc_s5zg]
+  [: @ a_a3fv sc_s5zb sc_s5zc]
+
+Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
+-}
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index f7ff85b..1ee56ec 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -212,3 +212,4 @@ test('T9565', only_ways(['optasm']), compile, [''])
 test('T5821', only_ways(['optasm']), compile, [''])
 test('T10176', only_ways(['optasm']), compile, [''])
 test('T10180', only_ways(['optasm']), compile, [''])
+test('T10602', only_ways(['optasm']), compile, ['-O2'])



More information about the ghc-commits mailing list