Commit c1d4cd7e authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #7924

parent 78618d45
{-# LANGUAGE DeriveDataTypeable #-}
module Main where
import Control.Exception (throwIO, Exception)
import Control.Monad (when)
import Data.Typeable (Typeable)
data Boom = Boom deriving (Show, Typeable)
instance Exception Boom
main = do
args <- return []
-- Should throw this exception.
when (length args /= 1) (throwIO Boom)
-- With -O, instead throws this one from head [].
let n = read (head args)
print (n :: Int)
return ()
\ No newline at end of file
......@@ -57,3 +57,5 @@ test('T5915', only_ways(['normal','optasm']), compile_and_run, [''])
test('T5920', only_ways(['normal','optasm']), compile_and_run, [''])
test('T5997', normal, compile_and_run, [''])
test('T7101', normal, compile_and_run, [''])
test('T7924', exit_code(1), compile_and_run, [''])
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