Commit 3bc60be8 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add tests for catching exceptions on Windows

parent 7f4585e0
......@@ -7,3 +7,11 @@ test('testblockalloc', compose(c_src,
# See bug #101, test requires +RTS -c (or equivalently +RTS -M<something>)
# only GHCi triggers the bug, but we run the test all ways for completeness.
test('bug1010', normal, compile_and_run, ['+RTS -c -RTS'])
test('derefnull',
compose(exit_code(139),
exit_code_if_platform(5, 'i386-unknown-mingw32')),
compile_and_run, [''])
test('divbyzero',
compose(exit_code(136),
exit_code_if_platform(5, 'i386-unknown-mingw32')),
compile_and_run, [''])
{-
By default, on Windows a segfault will pop up an annoying dialog box.
We want the RTS to catch it instead.
-}
module Main where
import Foreign
main :: IO ()
main = do x <- peek nullPtr
print (x :: Int)
{-
By default, on Windows a division-by-zero will pop up an annoying dialog box.
We want the RTS to catch it instead.
-}
module Main where
import GHC.Base
main :: IO ()
main = print (5 `divInt` 0)
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