X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftests%2Fccall%2Fcc001.hs;fp=ghc%2Fcompiler%2Ftests%2Fccall%2Fcc001.hs;h=8c37355ca398bc7b8552e0f9ec9f62c9a8952ac5;hb=e7d21ee4f8ac907665a7e170c71d59e13a01da09;hp=0000000000000000000000000000000000000000;hpb=e48474bff05e6cfb506660420f025f694c870d38;p=ghc-hetmet.git diff --git a/ghc/compiler/tests/ccall/cc001.hs b/ghc/compiler/tests/ccall/cc001.hs new file mode 100644 index 0000000..8c37355 --- /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 + + +