Commit c8adbae0 authored by sewardj's avatar sewardj
Browse files

[project @ 2002-02-22 12:36:01 by sewardj]

new-library-ise
parent 9bec2a1a
......@@ -6,7 +6,7 @@ include ($confdir ++ "/../vanilla-test.T")
-- Use this itsy helper fn to pass in an extra flag
def myvtc($extra_comp_args)
{
vtc(" -fglasgow-exts -package lang " ++ $extra_comp_args)
vtc(" -fglasgow-exts " ++ $extra_comp_args)
}
$compile_to_hc = "True"
......
-- !!! cc005 -- foreign export declarations
module ShouldCompile (d8) where
import Foreign
import GlaExts
import Int
import Word
import GHC.Ptr --import Foreign
--import GlaExts
--import Int
--import Word
type Addr = Ptr ()
foreign import ccall "wrapper" d8 :: (Int -> IO ()) -> IO Addr
-- exporting functions
......
......@@ -3,10 +3,10 @@
module ShouldCompile where
import Foreign
import CCall
import GHC.Base --CCall
import Foreign.ForeignPtr
-- Test returning results
type ForeignObj = ForeignPtr ()
a :: IO Int
a = _ccall_ a
......
-- !!! cc008 -- foreign export dynamic returning newtype of Addr
module ShouldCompile where
import Addr
import Foreign
type Addr = Ptr ()
newtype NPtr a = NPtr Addr
newtype Ptr a = Ptr Addr
foreign import ccall "wrapper" mkFoo :: IO () -> IO (Ptr Int)
foreign import ccall "wrapper" mkFoo :: IO () -> IO (NPtr Int)
-- !!! cc009 -- foreign label returning newtype of Addr
module ShouldCompile where
import Addr
import Foreign
type Addr = Ptr ()
newtype NPtr a = NPtr Addr
newtype Ptr a = Ptr Addr
foreign import ccall "&" foo :: Ptr Int
foreign import ccall "&" foo :: NPtr Int
module ShouldCompile where
import Foreign
foreign import ccall "dynamic" imp :: Addr -> Int
foreign import ccall "dynamic" imp :: Ptr () -> 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