Commit 0cc40030 authored by Ian Lynagh's avatar Ian Lynagh

Add a test for returning Int64s through the FFI

parent 0523c047
......@@ -89,3 +89,9 @@ clean(['ffi015_cbits.o'])
test('ffi016', omit_ways(['ghci']), compile_and_run, [''])
test('ffi017', normal, compile_and_run, [''])
# There's a dependency between these next two lines as the ghci way needs
# the .o file the other ways make
test('ffi018', omit_ways(['ghci']), compile_and_run, ['ffi018_c.c'])
test('ffi018', only_ways(['ghci']), compile_and_run, ['ffi018_c.o'])
clean(['ffi018_c.o'])
#include <sys/types.h>
int64_t f(void);
import Data.Int
main :: IO ()
main = do x <- f
print (x == 0x123456789ABCDEF0)
foreign import ccall "ffi018.h f"
f :: IO Int64
#include "ffi018.h"
int64_t f(void) {
return 0x123456789ABCDEF0LL;
}
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