Add T12520 as a test
authorÖmer Sinan Ağacan <omeragacan@gmail.com>
Tue, 23 Aug 2016 06:53:11 +0000 (06:53 +0000)
committerÖmer Sinan Ağacan <omeragacan@gmail.com>
Tue, 23 Aug 2016 06:53:11 +0000 (06:53 +0000)
  #12520 was already fixed in HEAD. Adding a test to make sure it stays fixed.

testsuite/tests/ghci/scripts/T12520.hs [new file with mode: 0644]
testsuite/tests/ghci/scripts/T12520.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/T12520.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/all.T

diff --git a/testsuite/tests/ghci/scripts/T12520.hs b/testsuite/tests/ghci/scripts/T12520.hs
new file mode 100644 (file)
index 0000000..cedf587
--- /dev/null
@@ -0,0 +1,14 @@
+{-# LANGUAGE MagicHash, UnboxedTuples #-}
+
+module Bug ( box, wrap, proxy ) where
+
+import GHC.Prim
+
+box :: (# Proxy# a, b #) -> b
+box (# x, y #) = y
+
+wrap :: b -> Proxy# a -> (# Proxy# a, b #)
+wrap x = \i# -> (# i#, x #)
+
+proxy :: () -> Proxy# a
+proxy () = proxy#
diff --git a/testsuite/tests/ghci/scripts/T12520.script b/testsuite/tests/ghci/scripts/T12520.script
new file mode 100644 (file)
index 0000000..6d6b683
--- /dev/null
@@ -0,0 +1,2 @@
+:load T12520
+box (wrap "foo" (proxy ()))
diff --git a/testsuite/tests/ghci/scripts/T12520.stdout b/testsuite/tests/ghci/scripts/T12520.stdout
new file mode 100644 (file)
index 0000000..810c96e
--- /dev/null
@@ -0,0 +1 @@
+"foo"
index 303fd39..70422dc 100755 (executable)
@@ -258,3 +258,4 @@ test('T11376', normal, ghci_script, ['T11376.script'])
 test('T12007', normal, ghci_script, ['T12007.script'])
 test('T11975', normal, ghci_script, ['T11975.script'])
 test('T10963', normal, ghci_script, ['T10963.script'])
+test('T12520', normal, ghci_script, ['T12520.script'])