summaryrefslogtreecommitdiff
path: root/testsuite/tests/numeric/should_run/numrun013.hs
blob: 8f7966ec3c36e78c1b00d0035bed70faf4ea992e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

-- Test for trac #1042

import Control.Exception
import Data.Int

main :: IO ()
main = do print ((minBound :: Int) `div` (-1))   `myCatch` print
          print ((minBound :: Int8) `div` (-1))  `myCatch` print
          print ((minBound :: Int16) `div` (-1)) `myCatch` print
          print ((minBound :: Int32) `div` (-1)) `myCatch` print
          print ((minBound :: Int64) `div` (-1)) `myCatch` print

myCatch :: IO a -> (ArithException -> IO a) -> IO a
myCatch = catch