summaryrefslogtreecommitdiff
path: root/testsuite/tests/numeric/should_run/T18359.hs
blob: 16deba75dd8ef1b8bde40674cba7e95d088e644b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# LANGUAGE MagicHash #-}

import GHC.Num.BigNat
import GHC.Num.Primitives
import GHC.Prim.Exception
import GHC.Exts
import Control.Exception

main :: IO ()
main = do
   foo  `catch` \DivideByZero -> putStrLn "Caught DivideByZero exception in foo"
   foo2 `catch` \DivideByZero -> putStrLn "Caught DivideByZero exception in foo2"

foo2 = case raiseDivZero of
   I# _ -> print "NOPE"

foo :: IO ()
foo = print (W# (bigNatRemWord# (bigNatOne void#) 0##))