From 8acdfdfb5c7442e0445ad9e767927c5661ce8d04 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Fri, 14 May 2021 08:57:06 +0100 Subject: Add test for #19841 --- testsuite/tests/stranal/should_run/T19841.hs | 14 ++++++++++++++ testsuite/tests/stranal/should_run/T19841.stderr | 2 ++ testsuite/tests/stranal/should_run/all.T | 1 + 3 files changed, 17 insertions(+) create mode 100644 testsuite/tests/stranal/should_run/T19841.hs create mode 100644 testsuite/tests/stranal/should_run/T19841.stderr diff --git a/testsuite/tests/stranal/should_run/T19841.hs b/testsuite/tests/stranal/should_run/T19841.hs new file mode 100644 index 0000000000..ff05c19297 --- /dev/null +++ b/testsuite/tests/stranal/should_run/T19841.hs @@ -0,0 +1,14 @@ +module Main where + +import Control.Exception +import Debug.Trace +import System.IO + +data MyException = MyException deriving Show +instance Exception MyException + +main :: IO () +main = handle (\ MyException -> hPutStrLn stderr "Exception") $ do + trace "Debugging" 5 + `seq` throw MyException + `seq` hPutStrLn stderr "Survived Exception" diff --git a/testsuite/tests/stranal/should_run/T19841.stderr b/testsuite/tests/stranal/should_run/T19841.stderr new file mode 100644 index 0000000000..d5f1763b70 --- /dev/null +++ b/testsuite/tests/stranal/should_run/T19841.stderr @@ -0,0 +1,2 @@ +Debugging +Exception diff --git a/testsuite/tests/stranal/should_run/all.T b/testsuite/tests/stranal/should_run/all.T index e28b0ef7ee..47a4af4e5a 100644 --- a/testsuite/tests/stranal/should_run/all.T +++ b/testsuite/tests/stranal/should_run/all.T @@ -27,3 +27,4 @@ test('T14290', normal, compile_and_run, ['']) test('T14285', normal, multimod_compile_and_run, ['T14285', '']) test('T17676', normal, compile_and_run, ['']) test('T19053', normal, compile_and_run, ['']) +test('T19841', normal, compile_and_run, ['']) -- cgit v1.2.1