Commit ac121a7a authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fix the haddock tests when going via C

We need to have a header which claims the foreign imports we do are
for entities that actually exist. Otherwise the C compiler complains.
parent 9c80aed3
......@@ -253,7 +253,7 @@ We can also include URLs in documentation: <http://www.haskell.org/>.
f :: C a => a -> Int
-- | we can export foreign declarations too
foreign import ccall g :: Int -> IO CInt
foreign import ccall "header.h" g :: Int -> IO CInt
-- | this doc string has a parse error in it: \'
h :: Int
......@@ -380,7 +380,7 @@ newn = undefined
-- | A foreign import with argument docs
foreign import ccall unsafe
foreign import ccall unsafe "header.h"
o :: Float -- ^ The input float
-> IO Float -- ^ The output float
......
......@@ -96,7 +96,7 @@ data R1
<document comment>
f :: (C a) => a -> Int
<document comment>
foreign import ccall safe "static &g" g :: Int -> IO CInt
foreign import ccall safe "static header.h &g" g :: Int -> IO CInt
<document comment>
h :: Int
h = 42
......@@ -131,7 +131,7 @@ m :: R -> N1 () <document comment> -> IO Int <document comment>
newn :: R <document comment> -> N1 () <document comment> -> IO Int
newn = undefined
<document comment>
foreign import ccall unsafe "static &o" o :: Float <document comment>
foreign import ccall unsafe "static header.h &o" o :: Float <document comment>
-> IO Float <document comment>
<document comment>
newp :: Int
......
/* These are used in Test.hs */
extern int g(HsInt x);
extern HsFloat o(HsFloat x);
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