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
5bbc839e
Commit
5bbc839e
authored
Nov 10, 2010
by
Ian Lynagh
Browse files
Add a test for
#4464
: -rtsopts and dynamic libraries
parent
5695c1aa
Changes
7
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/dynlibs/Makefile
View file @
5bbc839e
...
...
@@ -13,3 +13,20 @@ T3807:
'
$(TEST_HC)
'
T3807-load.c
-o
T3807-load
-ldl
./T3807-load
.PHONY
:
T4464
T4464
:
$(RM)
T4464B.o T4464C.o T4464H.hi T4464H.o
$(RM)
T4464H_stub.c T4464H_stub.h T4464H_stub.o
$(RM)
HS4464.dll HS4464.dll.a t4464.exe
'
$(TEST_HC)
'
-v0
-shared
T4464H.hs T4464B.c
-o
HS4464.dll
'
$(TEST_HC)
'
-v0
T4464C.c HS4464.dll.a
-o
t4464.exe
-
./t4464.exe
echo
"====="
echo
"====="
>
&2
$(RM)
T4464B.o T4464C.o T4464H.hi T4464H.o
$(RM)
T4464H_stub.c T4464H_stub.h T4464H_stub.o
$(RM)
HS4464.dll HS4464.dll.a t4464.exe
'
$(TEST_HC)
'
-v0
-shared
T4464H.hs T4464B.c
-o
HS4464.dll
-rtsopts
'
$(TEST_HC)
'
-v0
T4464C.c HS4464.dll.a
-o
t4464.exe
./t4464.exe
testsuite/tests/ghc-regress/dynlibs/T4464.stderr
0 → 100644
View file @
5bbc839e
Creating library file: HS4464.dll.a
ghcDll: Most RTS options are disabled. Link with -rtsopts to enable them.
=====
Creating library file: HS4464.dll.a
testsuite/tests/ghc-regress/dynlibs/T4464.stdout
0 → 100644
View file @
5bbc839e
=====
f 12 = 13
testsuite/tests/ghc-regress/dynlibs/T4464B.c
0 → 100644
View file @
5bbc839e
#include <Rts.h>
extern
void
__stginit_T4464H
(
void
);
void
HsStart
(
void
)
{
int
argc
=
3
;
char
*
argv
[]
=
{
"ghcDll"
,
"+RTS"
,
"-H50M"
,
NULL
};
// argv must end with NULL
// Initialize Haskell runtime
char
**
args
=
argv
;
hs_init
(
&
argc
,
&
args
);
// Tell Haskell about all root modules
hs_add_root
(
__stginit_T4464H
);
}
void
HsEnd
(
void
)
{
hs_exit
();
}
testsuite/tests/ghc-regress/dynlibs/T4464C.c
0 → 100644
View file @
5bbc839e
#include "HsFFI.h"
#include "T4464H_stub.h"
#include <stdio.h>
void
HsStart
(
void
);
void
HsEnd
(
void
);
int
main
(
void
)
{
HsStart
();
printf
(
"f 12 = %i
\n
"
,
f
(
12
));
HsEnd
();
return
0
;
}
testsuite/tests/ghc-regress/dynlibs/T4464H.hs
0 → 100644
View file @
5bbc839e
{-# LANGUAGE ForeignFunctionInterface #-}
module
T4464H
where
f
::
Int
->
Int
f
x
=
x
+
1
foreign
export
ccall
f
::
Int
->
Int
testsuite/tests/ghc-regress/dynlibs/all.T
View file @
5bbc839e
...
...
@@ -11,3 +11,11 @@ test('T3807',
run_command
,
['
$MAKE --no-print-directory -s T3807
'])
test
('
T4464
',
[
extra_clean
(['
T4464B.o
',
'
T4464C.o
',
'
T4464H.hi
',
'
T4464H.o
',
'
T4464H_stub.c
',
'
T4464H_stub.h
',
'
T4464H_stub.o
',
'
HS4464.dll
',
'
HS4464.dll.a
',
'
t4464.exe
']),
unless_os
('
mingw32
',
skip
)],
run_command
,
['
$MAKE --no-print-directory -s T4464
'])
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