@@ -18,6 +18,9 @@ mystruct = foreign FFI_C "&mystruct" (IO Ptr)
18print_mystruct : IO ()
18print_mystruct : IO ()
19print_mystruct = foreign FFI_C "print_mystruct" (IO ())
19print_mystruct = foreign FFI_C "print_mystruct" (IO ())
21+calc_struct : Ptr -> IO Ptr
22+calc_struct = foreign FFI_C "calc_struct" (Ptr -> IO Ptr)
21test1 : Composite
24test1 : Composite
22test1 = STRUCT [I8, I64]
25test1 = STRUCT [I8, I64]
@@ -46,3 +49,10 @@ main = do
46 print !(peek I32 f1)
49 print !(peek I32 f1)
47 withAlloc PTR $ \p =>
50 withAlloc PTR $ \p =>
48 poke PTR p fms
51 poke PTR p fms
52+ res <- withAlloc test1 $ \p => do
53+ let f1 = (test1 # 0) p
54+ let f2 = (test1 # 1) p
56+ poke I64 f2 1125899906842624