Commit 4e4ef30a authored by simonmar's avatar simonmar
Browse files

[project @ 2002-02-05 09:42:58 by simonmar]

Update these tests w.r.t. the new FFI syntax.
parent 0da55bae
......@@ -8,8 +8,8 @@ import Word
-- importing functions
foreign import stdcall "m" m_stdcall :: StablePtr a -> IO (StablePtr b)
foreign import ccall "m" unsafe m_ccall :: ByteArray Int -> IO Int
foreign import stdcall "m" m_stdcall :: StablePtr a -> IO (StablePtr b)
foreign import ccall unsafe "m" m_ccall :: ByteArray Int -> IO Int
foreign import stdcall "sin" my_sin :: Double -> IO Double
foreign import stdcall "cos" my_cos :: Double -> IO Double
......@@ -19,12 +19,12 @@ foreign import stdcall "m2" m16 :: IO Int16
foreign import stdcall "m3" m32 :: IO Int32
foreign import stdcall "m4" m64 :: IO Int64
foreign import stdcall dynamic d8 :: Addr -> IO Int8
foreign import stdcall dynamic d16 :: Addr -> IO Int16
foreign import stdcall dynamic d32 :: Addr -> IO Int32
foreign import stdcall dynamic d64 :: Addr -> IO Int64
foreign import stdcall "dynamic" d8 :: Addr -> IO Int8
foreign import stdcall "dynamic" d16 :: Addr -> IO Int16
foreign import stdcall "dynamic" d32 :: Addr -> IO Int32
foreign import stdcall "dynamic" d64 :: Addr -> IO Int64
foreign import ccall "kitchen" unsafe
foreign import ccall unsafe "kitchen"
sink :: ForeignObj
-> ByteArray Int
-> MutableByteArray Int RealWorld
......@@ -42,7 +42,7 @@ foreign import ccall "kitchen" unsafe
-> IO ()
foreign import ccall dynamic unsafe
foreign import ccall unsafe "dynamic"
sink2 :: Addr
-> (ForeignObj
-> ByteArray Int
......
......@@ -6,7 +6,7 @@ import GlaExts
import Int
import Word
foreign export ccall dynamic d8 :: (Int -> IO ()) -> IO Addr
foreign import ccall "wrapper" d8 :: (Int -> IO ()) -> IO Addr
-- exporting functions
{-
......
-- !!! cc007 -- foreign import with external name equal to Haskell name.
module ShouldCompile where
foreign import sine :: Double -> Double
foreign import ccall sine :: Double -> Double
......@@ -5,4 +5,4 @@ import Addr
newtype Ptr a = Ptr Addr
foreign export dynamic mkFoo :: IO () -> IO (Ptr Int)
foreign import ccall "wrapper" mkFoo :: IO () -> IO (Ptr Int)
......@@ -5,4 +5,4 @@ import Addr
newtype Ptr a = Ptr Addr
foreign label foo :: Ptr Int
foreign import ccall "&" foo :: Ptr Int
module ShouldCompile where
import Foreign
foreign import dynamic imp :: Addr -> Int
foreign import ccall "dynamic" imp :: Addr -> Int
f1 a = imp a + 1
f2 a = imp a + 2
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