Add failing test case for T13611
authorJoachim Breitner <mail@joachim-breitner.de>
Mon, 24 Apr 2017 17:15:47 +0000 (13:15 -0400)
committerJoachim Breitner <mail@joachim-breitner.de>
Mon, 24 Apr 2017 17:16:19 +0000 (13:16 -0400)
this program should be rejected, but is not (and segfaults).

testsuite/tests/typecheck/should_fail/T13611.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T13611.hs b/testsuite/tests/typecheck/should_fail/T13611.hs
new file mode 100644 (file)
index 0000000..ea22791
--- /dev/null
@@ -0,0 +1,9 @@
+{-# LANGUAGE MagicHash, UnboxedTuples #-}
+import GHC.Prim
+import GHC.Types
+
+main = do
+    let local = ()
+    let null = 0## :: Word#
+    let triple = (# local, null, null #)
+    IO (\s -> case mkWeakNoFinalizer# triple () s of (# s, r #) -> (# s, () #))
index c8d5869..8bbb671 100644 (file)
@@ -434,3 +434,4 @@ test('T13300', normal, compile_fail, [''])
 test('T12709', normal, compile_fail, [''])
 test('T13446', normal, compile_fail, [''])
 test('T13506', normal, compile_fail, [''])
+test('T13611', expect_broken(13611), compile_fail, [''])