summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-05-03 08:51:29 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2018-05-03 08:51:29 +0100
commit6742ce2d8e0919dd75b5ecb0e2b5f891c442bdd3 (patch)
tree02072acd7bae280a6ecd503a4a0b99acf56c4d00 /testsuite
parent198db048f60f48b420ac4ad9264af57185b4b41a (diff)
downloadhaskell-6742ce2d8e0919dd75b5ecb0e2b5f891c442bdd3.tar.gz
Test Trac #15114
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/simplCore/should_run/T15114.hs23
-rw-r--r--testsuite/tests/simplCore/should_run/T15114.stdout1
-rw-r--r--testsuite/tests/simplCore/should_run/all.T1
3 files changed, 25 insertions, 0 deletions
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, [''])