diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-09-18 10:02:57 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-09-19 09:06:36 -0400 |
commit | 521739900fe993ff73ec0da2215bc7572a15826d (patch) | |
tree | 850126e29b2d2607bc1f8cc900e51f79139adb1c /testsuite/tests/simplCore | |
parent | 2a8867cfa6b6aa3f8b35a9506f4058bb5d37f7dc (diff) | |
download | haskell-521739900fe993ff73ec0da2215bc7572a15826d.tar.gz |
testsuite: Add testcase for #17206
Diffstat (limited to 'testsuite/tests/simplCore')
-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, ['']) |