Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
f6282fe0
Commit
f6282fe0
authored
Oct 01, 2003
by
simonmar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[project @ 2003-10-01 09:11:36 by simonmar]
Add test for returning a Bool from a foreign export.
parent
ca6b9b66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
testsuite/tests/ghc-regress/ccall/should_run/all.T
testsuite/tests/ghc-regress/ccall/should_run/all.T
+2
-0
testsuite/tests/ghc-regress/ccall/should_run/ffi011.hs
testsuite/tests/ghc-regress/ccall/should_run/ffi011.hs
+19
-0
testsuite/tests/ghc-regress/ccall/should_run/ffi011.stdout
testsuite/tests/ghc-regress/ccall/should_run/ffi011.stdout
+2
-0
No files found.
testsuite/tests/ghc-regress/ccall/should_run/all.T
View file @
f6282fe0
...
...
@@ -42,3 +42,5 @@ test('ffi009', expect_fail_for(['optasm','extcore', 'optextcore']), compile_and_
# Doesn't work with External Core due to __labels
test
('
ffi010
',
expect_fail_for
(['
extcore
','
optextcore
']),
compile_and_run
,
[''])
test
('
ffi011
',
normal
,
compile_and_run
,
[''])
testsuite/tests/ghc-regress/ccall/should_run/ffi011.hs
0 → 100644
View file @
f6282fe0
{-# OPTIONS -fffi #-}
-- !!! returning a Bool from a foreign export confused GHCi 6.0.1.
import
Foreign
foreign
import
ccall
"wrapper"
mkFoo
::
(
Int
->
IO
Bool
)
->
IO
(
FunPtr
(
Int
->
IO
Bool
))
foo
::
Int
->
IO
Bool
foo
x
=
return
(
x
==
42
)
foreign
import
ccall
"dynamic"
call_foo
::
FunPtr
(
Int
->
IO
Bool
)
->
Int
->
IO
Bool
main
=
do
foo_fun
<-
mkFoo
foo
call_foo
foo_fun
3
>>=
print
call_foo
foo_fun
42
>>=
print
testsuite/tests/ghc-regress/ccall/should_run/ffi011.stdout
0 → 100644
View file @
f6282fe0
False
True
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment