diff options
Diffstat (limited to 'testsuite/tests/ffi/should_run/ffi008.hs')
-rw-r--r-- | testsuite/tests/ffi/should_run/ffi008.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/ffi/should_run/ffi008.hs b/testsuite/tests/ffi/should_run/ffi008.hs new file mode 100644 index 0000000000..f065e49855 --- /dev/null +++ b/testsuite/tests/ffi/should_run/ffi008.hs @@ -0,0 +1,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 |