diff options
-rw-r--r-- | testsuite/tests/simplCore/should_run/T17206.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_run/T17206.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_run/all.T | 1 |
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, ['']) |