summaryrefslogtreecommitdiff
path: root/testsuite/tests/ffi
diff options
context:
space:
mode:
authorPaolo Capriotti <p.capriotti@gmail.com>2012-04-05 12:48:39 +0100
committerPaolo Capriotti <p.capriotti@gmail.com>2012-04-05 12:48:39 +0100
commit17f3e90e4dfe01ea40cfde4928fc78b62cd1033f (patch)
tree672a3cb5d13cbf774a29d196933b9739d96a9f02 /testsuite/tests/ffi
parentf90a4e1abc80df73d4d6c1532ed8b6bc83f69142 (diff)
downloadhaskell-17f3e90e4dfe01ea40cfde4928fc78b62cd1033f.tar.gz
Fix dynamic stub in tests after fix for #5664.
Diffstat (limited to 'testsuite/tests/ffi')
-rw-r--r--testsuite/tests/ffi/should_compile/cc004.hs37
-rw-r--r--testsuite/tests/ffi/should_compile/cc005.hs2
-rw-r--r--testsuite/tests/ffi/should_compile/cc008.hs2
-rw-r--r--testsuite/tests/ffi/should_compile/cc010.hs2
4 files changed, 22 insertions, 21 deletions
diff --git a/testsuite/tests/ffi/should_compile/cc004.hs b/testsuite/tests/ffi/should_compile/cc004.hs
index fb754223b2..89c2aa8319 100644
--- a/testsuite/tests/ffi/should_compile/cc004.hs
+++ b/testsuite/tests/ffi/should_compile/cc004.hs
@@ -26,10 +26,10 @@ 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 :: Ptr a -> IO Int8
-foreign import stdcall "dynamic" d16 :: Ptr a -> IO Int16
-foreign import stdcall "dynamic" d32 :: Ptr a -> IO Int32
-foreign import stdcall "dynamic" d64 :: Ptr a -> IO Int64
+foreign import stdcall "dynamic" d8 :: FunPtr (IO Int8) -> IO Int8
+foreign import stdcall "dynamic" d16 :: FunPtr (IO Int16) -> IO Int16
+foreign import stdcall "dynamic" d32 :: FunPtr (IO Int32) -> IO Int32
+foreign import stdcall "dynamic" d64 :: FunPtr (IO Int64) -> IO Int64
foreign import ccall unsafe "kitchen"
sink :: Ptr a
@@ -49,19 +49,20 @@ foreign import ccall unsafe "kitchen"
-> IO ()
+type Sink2 b = Ptr b
+ -> ByteArray#
+ -> MutableByteArray# RealWorld
+ -> Int
+ -> Int8
+ -> Int16
+ -> Int32
+ -> Word8
+ -> Word16
+ -> Word32
+ -> Float
+ -> Double
+ -> IO ()
+
foreign import ccall unsafe "dynamic"
- sink2 :: Ptr a
- -> (Ptr b
- -> ByteArray#
- -> MutableByteArray# RealWorld
- -> Int
- -> Int8
- -> Int16
- -> Int32
- -> Word8
- -> Word16
- -> Word32
- -> Float
- -> Double
- -> IO ())
+ sink2 :: Ptr (Sink2 b) -> Sink2 b
diff --git a/testsuite/tests/ffi/should_compile/cc005.hs b/testsuite/tests/ffi/should_compile/cc005.hs
index e057cfd233..7086480bfe 100644
--- a/testsuite/tests/ffi/should_compile/cc005.hs
+++ b/testsuite/tests/ffi/should_compile/cc005.hs
@@ -5,7 +5,7 @@ import Foreign.Ptr --import Foreign
--import GlaExts
--import Int
--import Word
-type Addr = Ptr ()
+type Addr = FunPtr (Int -> IO ())
foreign import ccall "wrapper" d8 :: (Int -> IO ()) -> IO Addr
-- exporting functions
diff --git a/testsuite/tests/ffi/should_compile/cc008.hs b/testsuite/tests/ffi/should_compile/cc008.hs
index 2dd0bc99eb..b1581dd20d 100644
--- a/testsuite/tests/ffi/should_compile/cc008.hs
+++ b/testsuite/tests/ffi/should_compile/cc008.hs
@@ -2,7 +2,7 @@
module ShouldCompile where
import Foreign
-type Addr = Ptr ()
+type Addr = FunPtr (IO ())
newtype NPtr a = NPtr Addr
foreign import ccall "wrapper" mkFoo :: IO () -> IO (NPtr Int)
diff --git a/testsuite/tests/ffi/should_compile/cc010.hs b/testsuite/tests/ffi/should_compile/cc010.hs
index dd34730d42..abdf0fc76f 100644
--- a/testsuite/tests/ffi/should_compile/cc010.hs
+++ b/testsuite/tests/ffi/should_compile/cc010.hs
@@ -1,5 +1,5 @@
module ShouldCompile where
import Foreign
-foreign import ccall "dynamic" imp :: Ptr () -> Int
+foreign import ccall "dynamic" imp :: FunPtr Int -> Int
f1 a = imp a + 1
f2 a = imp a + 2