summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/ffi/should_run/ffi008.hs
blob: f065e4985512a2cbe2098612fc7bdb3c42c45951 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- !!! Test exceptions in a foreign import "wrapper"

import Foreign
import Foreign.C

import System.Exit

type IOF = IO ()
foreign import ccall "wrapper" wrap_f_io :: IOF -> IO (FunPtr IOF)
foreign import ccall "dynamic" call_io :: FunPtr IOF -> IOF

mk_error = error "this is an error"

main = do f <- wrap_f_io mk_error; call_io f