summaryrefslogtreecommitdiff
path: root/testsuite/tests/ffi/should_run/T2469.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ffi/should_run/T2469.hs')
-rw-r--r--testsuite/tests/ffi/should_run/T2469.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/ffi/should_run/T2469.hs b/testsuite/tests/ffi/should_run/T2469.hs
new file mode 100644
index 0000000000..dc68ad73bf
--- /dev/null
+++ b/testsuite/tests/ffi/should_run/T2469.hs
@@ -0,0 +1,15 @@
+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
+
+double_io :: Int -> IO Int
+double_io x = return (x * 2)
+
+main = do
+ double2 <- wrap_f_io double_io
+ x <- f_io double2 42
+ return ()