Commit 504e4c0f authored by Simon Marlow's avatar Simon Marlow

add test for #4038

parent 51055963
{-# LANGUAGE ForeignFunctionInterface #-}
import Foreign
import Foreign.C
type IOF = Int -> IO Int
foreign import ccall "wrapper" wrap_f_io :: IOF -> IO (FunPtr IOF)
foreign import ccall "dynamic" f_io :: FunPtr IOF -> IOF
f :: Int -> IO Int
f 0 = return 42
f n = do
f' <- wrap_f_io f
f_io f' (n-1)
main = f 1000 >>= print
......@@ -157,3 +157,5 @@ test('ffi020', [ omit_ways(prof_ways),
test('ffi021', normal, compile_and_run, [''])
test('4038', normal, compile_and_run, [''])
Markdown is supported
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