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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/8c43b9499cd002758a86515044eaeaa2b2015096

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

commit 8c43b9499cd002758a86515044eaeaa2b2015096
Author: Simon Marlow <[email protected]>
Date:   Thu Jul 14 14:19:20 2011 +0100

    test for #5313

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

 tests/ghc-regress/driver/5313.hs |   18 ++++++++++++++++++
 tests/ghc-regress/driver/all.T   |    8 ++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/tests/ghc-regress/driver/5313.hs b/tests/ghc-regress/driver/5313.hs
new file mode 100644
index 0000000..14b809b
--- /dev/null
+++ b/tests/ghc-regress/driver/5313.hs
@@ -0,0 +1,18 @@
+import qualified GHC
+import System.Environment
+
+main = do
+  (libdir:_) <- getArgs
+  GHC.runGhcT (Just libdir) $ do
+      -- begin initialize
+      df0 <- GHC.getSessionDynFlags
+      let df1 = df0{GHC.ghcMode    = GHC.CompManager,
+                    GHC.hscTarget  = GHC.HscInterpreted,
+                    GHC.ghcLink    = GHC.LinkInMemory,
+                    GHC.verbosity  = 0}
+      _ <- GHC.setSessionDynFlags df1
+      -- begin reset
+      GHC.setContext [] []
+      GHC.setTargets []
+      _ <- GHC.load GHC.LoadAllTargets
+      return ()
diff --git a/tests/ghc-regress/driver/all.T b/tests/ghc-regress/driver/all.T
index b7cc9e2..2c8d4d9 100644
--- a/tests/ghc-regress/driver/all.T
+++ b/tests/ghc-regress/driver/all.T
@@ -301,6 +301,14 @@ test('dynHelloWorld',
      compile_and_run,
      [''])
 
+# simple test that we can load and use the GHC package in all ways
+# (in #5313 it was failing the dyn way)
+p = subprocess.Popen([config.compiler, "--print-libdir"], 
stdout=subprocess.PIPE)
+libdir = p.stdout.read()
+p.stdout.close
+
+test('5313', extra_run_opts(libdir), compile_and_run, ['-package ghc'])
+
 test('2464', normal, compile, [''])
 test('3674', ignore_output, run_command, 
              ['$MAKE -s --no-print-directory 3674'])



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

Reply via email to