diff options
Diffstat (limited to 'testsuite/tests/ffi/should_compile/cc001.hs')
-rw-r--r-- | testsuite/tests/ffi/should_compile/cc001.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/ffi/should_compile/cc001.hs b/testsuite/tests/ffi/should_compile/cc001.hs new file mode 100644 index 0000000000..cd7318d000 --- /dev/null +++ b/testsuite/tests/ffi/should_compile/cc001.hs @@ -0,0 +1,21 @@ +-- !!! cc001 -- ccall with standard boxed arguments and results + +module ShouldCompile where + +-- simple functions + +foreign import ccall unsafe "a" a :: IO Int + +foreign import ccall unsafe "b" b :: Int -> IO Int + +foreign import ccall unsafe "c" + c :: Int -> Char -> Float -> Double -> IO Float + +-- simple monadic code + +d = a >>= \ x -> + b x >>= \ y -> + c y 'f' 1.0 2.0 + + + |