Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/de7a0e5f424d102e992f483c4bcf0488c8172d61

>---------------------------------------------------------------

commit de7a0e5f424d102e992f483c4bcf0488c8172d61
Author: Simon Marlow <[email protected]>
Date:   Wed Nov 16 13:05:12 2011 +0000

    Fix T4464 for the new way of handling main() and -rtsopts

>---------------------------------------------------------------

 tests/dynlibs/Makefile |    8 ++++----
 tests/dynlibs/T4464B.c |    9 +++++++++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/tests/dynlibs/Makefile b/tests/dynlibs/Makefile
index d83ca21..35e5788 100644
--- a/tests/dynlibs/Makefile
+++ b/tests/dynlibs/Makefile
@@ -18,16 +18,16 @@ 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)' $(TEST_HC_OPTS) -v0 -shared T4464H.hs T4464B.c -o 
HS4464.dll
-       '$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe
+       '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -shared T4464H.hs T4464B.c 
-optc-DRTSOPTS=RtsOptsSafeOnly -o HS4464.dll
+       '$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe 
-no-hs-main
        -./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)' $(TEST_HC_OPTS) -v0 -shared T4464H.hs T4464B.c -o 
HS4464.dll -rtsopts
-       '$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe
+       '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -shared T4464H.hs T4464B.c  
-optc-DRTSOPTS=RtsOptsAll -o HS4464.dll
+       '$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe 
-no-hs-main
        ./t4464.exe
 
 .PHONY: T5373
diff --git a/tests/dynlibs/T4464B.c b/tests/dynlibs/T4464B.c
index 0cd2845..fea4498 100644
--- a/tests/dynlibs/T4464B.c
+++ b/tests/dynlibs/T4464B.c
@@ -9,7 +9,16 @@ void HsStart(void) {
 
     // Initialize Haskell runtime
     char** args = argv;
+#if __GLASGOW_HASKELL__ >= 703
+    {
+        RtsConfig conf = defaultRtsConfig;
+        conf.rts_opts_enabled = RTSOPTS; // RTSOPTS defined on the
+                                         // command line with -DRTSOPTS=...
+        hs_init_ghc(&argc, &args, conf);
+    }
+#else
     hs_init(&argc, &args);
+#endif
 
     // Tell Haskell about all root modules
     hs_add_root(__stginit_T4464H);



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to