diff options
Diffstat (limited to 'ghc/compiler/tests/ccall/cc001.hs')
-rw-r--r-- | ghc/compiler/tests/ccall/cc001.hs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ghc/compiler/tests/ccall/cc001.hs b/ghc/compiler/tests/ccall/cc001.hs new file mode 100644 index 0000000000..8c37355ca3 --- /dev/null +++ b/ghc/compiler/tests/ccall/cc001.hs @@ -0,0 +1,25 @@ +--!!! cc001 -- ccall with standard boxed arguments and results + +module Test where + +import PreludeGlaIO + +-- simple functions + +a :: PrimIO Int +a = _ccall_ a + +b :: Int -> PrimIO Int +b x = _ccall_ b x + +c :: Int -> Char -> Float -> Double -> PrimIO Float +c x1 x2 x3 x4 = _ccall_ c x1 x2 x3 x4 + +-- simple monadic code + +d = a `thenPrimIO` \ x -> + b x `thenPrimIO` \ y -> + c y 'f' 1.0 2.0 + + + |