Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
1c8d7a29
Commit
1c8d7a29
authored
Jun 04, 2008
by
Simon Marlow
Browse files
fix up this test following the header-file changes in the C backend
parent
b996a457
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/ffi/should_compile/cc004.hs
View file @
1c8d7a29
...
...
@@ -9,11 +9,17 @@ import Data.Word
-- importing functions
foreign
import
stdcall
"m"
m_stdcall
::
StablePtr
a
->
IO
(
StablePtr
b
)
foreign
import
ccall
unsafe
"m"
m_ccall
::
ByteArray
#
->
IO
Int
-- We can't import the same function using both stdcall and ccall
-- calling conventions in the same file when compiling via C (this is a
-- restriction in the C backend caused by the need to emit a prototype
-- for stdcall functions).
foreign
import
stdcall
"p"
m_stdcall
::
StablePtr
a
->
IO
(
StablePtr
b
)
foreign
import
ccall
unsafe
"q"
m_ccall
::
ByteArray
#
->
IO
Int
foreign
import
stdcall
"sin"
my_sin
::
Double
->
IO
Double
foreign
import
stdcall
"cos"
my_cos
::
Double
->
IO
Double
-- We can't redefine the calling conventions of certain functions (those from
-- math.h).
foreign
import
stdcall
"my_sin"
my_sin
::
Double
->
IO
Double
foreign
import
stdcall
"my_cos"
my_cos
::
Double
->
IO
Double
foreign
import
stdcall
"m1"
m8
::
IO
Int8
foreign
import
stdcall
"m2"
m16
::
IO
Int16
...
...
Write
Preview
Supports
Markdown
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