From 6742ce2d8e0919dd75b5ecb0e2b5f891c442bdd3 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Thu, 3 May 2018 08:51:29 +0100 Subject: Test Trac #15114 --- testsuite/tests/simplCore/should_run/T15114.hs | 23 ++++++++++++++++++++++ testsuite/tests/simplCore/should_run/T15114.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 1 + 3 files changed, 25 insertions(+) create mode 100644 testsuite/tests/simplCore/should_run/T15114.hs create mode 100644 testsuite/tests/simplCore/should_run/T15114.stdout (limited to 'testsuite') diff --git a/testsuite/tests/simplCore/should_run/T15114.hs b/testsuite/tests/simplCore/should_run/T15114.hs new file mode 100644 index 0000000000..ef0e77c683 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T15114.hs @@ -0,0 +1,23 @@ +{-# OPTIONS_GHC -O #-} +-- Bug only showed up with optimisation on + +module Main where + +import qualified Control.Exception as Exception + +main :: IO () +main = do + unserialize + putStrLn "all is well" + +unserialize :: IO Char +unserialize = + if definitelyTrue + then do + return 'a' + else do + Exception.evaluate (error "wrong place") + +{-# NOINLINE definitelyTrue #-} +definitelyTrue :: Bool +definitelyTrue = True diff --git a/testsuite/tests/simplCore/should_run/T15114.stdout b/testsuite/tests/simplCore/should_run/T15114.stdout new file mode 100644 index 0000000000..0b9e820aee --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T15114.stdout @@ -0,0 +1 @@ +all is well diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index ca69565c26..3d8f540d20 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -84,3 +84,4 @@ test('T14868', compile_and_run, ['']) test('T14894', normal, compile_and_run, ['']) test('T14965', normal, compile_and_run, ['']) +test('T15114', only_ways('optasm'), compile_and_run, ['']) -- cgit v1.2.1