Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/7d1da4a5718851c40dcfe2336586326bc7a472c7

>---------------------------------------------------------------

commit 7d1da4a5718851c40dcfe2336586326bc7a472c7
Author: Paolo Capriotti <[email protected]>
Date:   Thu Apr 5 12:48:39 2012 +0100

    Fix dynamic stub in tests after fix for #5664.

>---------------------------------------------------------------

 tests/ffi/should_compile/cc004.hs |   37 +++++++++++++++++++------------------
 tests/ffi/should_compile/cc005.hs |    2 +-
 tests/ffi/should_compile/cc008.hs |    2 +-
 tests/ffi/should_compile/cc010.hs |    2 +-
 4 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/tests/ffi/should_compile/cc004.hs 
b/tests/ffi/should_compile/cc004.hs
index fb75422..89c2aa8 100644
--- a/tests/ffi/should_compile/cc004.hs
+++ b/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/tests/ffi/should_compile/cc005.hs 
b/tests/ffi/should_compile/cc005.hs
index e057cfd..7086480 100644
--- a/tests/ffi/should_compile/cc005.hs
+++ b/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/tests/ffi/should_compile/cc008.hs 
b/tests/ffi/should_compile/cc008.hs
index 2dd0bc9..b1581dd 100644
--- a/tests/ffi/should_compile/cc008.hs
+++ b/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/tests/ffi/should_compile/cc010.hs 
b/tests/ffi/should_compile/cc010.hs
index dd34730..abdf0fc 100644
--- a/tests/ffi/should_compile/cc010.hs
+++ b/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



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to