Commit 2baf8aa7 authored by simonpj's avatar simonpj
Browse files

Test Trac #3983

parent 6f3fc74a
module Main where
import T3983_Foo
import T3983_Bar
main = catchX (foo False True) >>= print
\ No newline at end of file
{-# LANGUAGE DeriveDataTypeable #-}
module T3983_Bar where
import Data.Dynamic
import Control.Exception
import Control.Monad (unless)
type Assertion = IO ()
data X = X String deriving (Show, Typeable)
instance Exception X
throwX = throw.X
catchX action = do { action; return True; } `catches` [Handler (\(X _) -> return False)]
\ No newline at end of file
module T3983_Foo where
import Control.Monad (unless)
import Control.Exception
import T3983_Bar
foo :: Bool -> Bool -> IO ()
foo a b = unless a $ throwX (if b then "" else "")
......@@ -33,3 +33,9 @@ test('SeqRule', only_ways(['optc','optasm']), compile_and_run, [''])
test('T3403', normal, compile_and_run, ['-package containers'])
test('T3591', normal, compile_and_run, [''])
# Run this test *without* optimisation too
test('T3983', [only_ways(['normal','optc','optasm']),
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment