summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-09-18 10:02:57 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-09-19 09:06:36 -0400
commit521739900fe993ff73ec0da2215bc7572a15826d (patch)
tree850126e29b2d2607bc1f8cc900e51f79139adb1c
parent2a8867cfa6b6aa3f8b35a9506f4058bb5d37f7dc (diff)
downloadhaskell-521739900fe993ff73ec0da2215bc7572a15826d.tar.gz
testsuite: Add testcase for #17206
-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, [''])