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

-- Test for trac #1042

import Control.Exception
import Data.Int
import Prelude hiding (catch)

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