summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-09-18 10:02:57 -0400
committerBen Gamari <ben@smart-cactus.org>2019-09-18 10:04:45 -0400
commitb3dbc109d205831968fcb49c20edd2e57eefc861 (patch)
tree08a3de3495521be7ca8eb0eb948886b3cfab4baa
parent867534750bcf66f6243f0b7d2d9ec11fa1defd04 (diff)
downloadhaskell-wip/T17206.tar.gz
testsuite: Add testcase for #17206wip/T17206
-rw-r--r--testsuite/tests/simplCore/should_run/T17206.hs16
-rw-r--r--testsuite/tests/simplCore/should_run/T17206.stdout2
-rw-r--r--testsuite/tests/simplCore/should_run/all.T1
3 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_run/T17206.hs b/testsuite/tests/simplCore/should_run/T17206.hs
new file mode 100644
index 0000000000..d63fa30a80
--- /dev/null
+++ b/testsuite/tests/simplCore/should_run/T17206.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
+module Main where
+
+import Prelude (IO, ($), (.), (>>=), putStrLn)
+import System.Exit (exitFailure)
+import Unsafe.Coerce (unsafeCoerce)
+
+sequ :: IO () -> IO a -> IO a
+sequ c c' = c >>= \ _ -> c'
+
+main :: IO ()
+main =
+ unsafeCoerce sequ (putStrLn "Hello,") $
+ unsafeCoerce sequ (putStrLn "world!") $
+ exitFailure
diff --git a/testsuite/tests/simplCore/should_run/T17206.stdout b/testsuite/tests/simplCore/should_run/T17206.stdout
new file mode 100644
index 0000000000..8469687556
--- /dev/null
+++ b/testsuite/tests/simplCore/should_run/T17206.stdout
@@ -0,0 +1,2 @@
+Hello,
+world!
diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T
index 0d27d11d7f..3a61665cdf 100644
--- a/testsuite/tests/simplCore/should_run/all.T
+++ b/testsuite/tests/simplCore/should_run/all.T
@@ -91,3 +91,4 @@ test('T15436', normal, compile_and_run, [''])
test('T15840', normal, compile_and_run, [''])
test('T15840a', normal, compile_and_run, [''])
test('T16066', exit_code(1), compile_and_run, ['-O1'])
+test('T17206', exit_code(1), compile_and_run, [''])