Commit eb9accfc authored by Simon Marlow's avatar Simon Marlow

add a test for foreign imports in GHCi

parent 7f1d4e74
......@@ -796,6 +796,9 @@ def ghci_script( name, way, script ):
' --interactive -v0 -ignore-dot-ghci ' + \
join(flags,' ')
if getTestOpts().cmd_prefix != '':
cmd = getTestOpts().cmd_prefix + ' ' + cmd;
getTestOpts().stdin = script
return simple_run( name, way, cmd, getTestOpts().extra_run_opts )
......
......@@ -31,3 +31,5 @@ ghci037:
'$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci < ghci037.script
'$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci -fno-ghci-sandbox < ghci037.script
ghci056_setup:
'$(TEST_HC)' $(TEST_HC_OPTS) -c ghci056_c.c
......@@ -72,6 +72,15 @@ test('ghci052', normal, ghci_script, ['ghci052.script'])
test('ghci053', normal, ghci_script, ['ghci053.script'])
test('ghci054', normal, ghci_script, ['ghci054.script'])
test('ghci055', normal, ghci_script, ['ghci055.script'])
test('ghci056',
[
cmd_prefix('$MAKE --no-print-directory ghci056_setup && '),
extra_run_opts('ghci056_c.o'),
extra_clean('ghci056_c.o')
],
ghci_script, ['ghci056.script'])
test('2452', normal, ghci_script, ['2452.script'])
test('T2766', normal, ghci_script, ['T2766.script'])
......
foreign import ccall "f" f :: Int -> Int -> Int
f 2 3
#include "HsFFI.h"
HsInt f (HsInt x, HsInt y)
{
return (x + y);
}
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