Commit b0f8f4f3 authored by Ian Lynagh's avatar Ian Lynagh

Fix some parallel testsuite problems

parent 57c674a0
import Foreign
import Foreign.C
foreign import stdcall "test" ctest :: CInt -> IO ()
main = ctest 3
#include <stdio.h>
void _stdcall test(int arg)
{
printf("The argument passed was %i\n", arg );
}
import Foreign
import Foreign.C
foreign import stdcall "&test" ptest :: FunPtr (CInt -> IO ())
foreign import stdcall "dynamic" ctest :: FunPtr (CInt -> IO ()) -> CInt -> IO ()
main = ctest ptest 3
#include <stdio.h>
void _stdcall test(int arg)
{
printf("The argument passed was %i\n", arg );
}
......@@ -3,13 +3,10 @@ include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
ffi018_ghci_setup :
cp ffi018_c.c ffi018_ghci_c.c
$(TEST_HC) -c ffi018_ghci_c.c
1288_ghci_setup :
cp 1288_c.c 1288_ghci_c.c
$(TEST_HC) -c 1288_ghci_c.c
2276_ghci_setup :
cp 2276_c.c 2276_ghci_c.c
$(TEST_HC) -c 2276_ghci_c.c
......@@ -97,10 +97,10 @@ test('ffi017', normal, compile_and_run, [''])
test('ffi018', [ omit_ways(['ghci']), extra_clean(['ffi018_c.o']) ],
compile_and_run, ['ffi018_c.c'])
test('ffi018', [ only_ways(['ghci']),
cmd_prefix('$MAKE ffi018_ghci_setup && '),
extra_clean(['ffi018_ghci_c.c', 'ffi018_ghci_c.o']) ],
compile_and_run, ['ffi018_ghci_c.o'])
test('ffi018_ghci', [ only_ways(['ghci']),
cmd_prefix('$MAKE ffi018_ghci_setup && '),
extra_clean(['ffi018_ghci_c.o']) ],
compile_and_run, ['ffi018_ghci_c.o'])
test('ffi019', normal, compile_and_run, [''])
......@@ -110,15 +110,15 @@ test('1679', normal, compile_and_run, [''])
test('1288', [ skip_if_not_windows, omit_ways(['ghci']),
extra_clean(['1288_c.o']) ],
compile_and_run, ['1288_c.c'])
test('1288', [ skip_if_not_windows, only_ways(['ghci']),
cmd_prefix('$MAKE --no-print-directory 1288_ghci_setup && '),
extra_clean(['1288_ghci_c.c', '1288_ghci_c.o']) ],
compile_and_run, ['1288_ghci_c.o'])
test('1288_ghci', [ skip_if_not_windows, only_ways(['ghci']),
cmd_prefix('$MAKE --no-print-directory 1288_ghci_setup && '),
extra_clean(['1288_ghci_c.o']) ],
compile_and_run, ['1288_ghci_c.o'])
test('2276', [ skip_if_not_windows, omit_ways(['ghci']),
extra_clean(['2276_c.o']) ],
compile_and_run, ['2276_c.c'])
test('2276', [ skip_if_not_windows, only_ways(['ghci']),
cmd_prefix('$MAKE --no-print-directory 2276_ghci_setup && '),
extra_clean(['2276_ghci_c.c', '2276_ghci_c.o']) ],
compile_and_run, ['-fobject-code 2276_ghci_c.o'])
test('2276_ghci', [ skip_if_not_windows, only_ways(['ghci']),
cmd_prefix('$MAKE --no-print-directory 2276_ghci_setup && '),
extra_clean(['2276_ghci_c.o']) ],
compile_and_run, ['-fobject-code 2276_ghci_c.o'])
import Data.Int
main :: IO ()
main = do x <- f
print (x == 0x123456789ABCDEF0)
foreign import ccall "ffi018.h f"
f :: IO Int64
#include "ffi018.h"
HsInt64 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