Commit 677872fa authored by Simon Marlow's avatar Simon Marlow

add test for #2276

parent cd10aa46
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 );
}
......@@ -9,3 +9,7 @@ ffi018_ghci_setup :
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
......@@ -118,3 +118,11 @@ test('1288', [ skip_if_not_windows, only_ways(['ghci']),
extra_clean(['1288_ghci_c.c', '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 -C ' + getTestDir() +
' 2276_ghci_setup && '),
extra_clean(['2276_ghci_c.c', '2276_ghci_c.o']) ],
compile_and_run, ['-fobject-code 2276_ghci_c.o'])
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