diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-07-14 14:19:20 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-07-14 14:26:40 +0100 |
commit | 7f6a5a688c9bdda87c0793d47dc8e6c7aa8b5186 (patch) | |
tree | 6b4b997b67a097882bb796e12c1920008e272a79 | |
parent | d7b647a4cd66e821a5afc2cfcf9c57513c89a132 (diff) | |
download | haskell-7f6a5a688c9bdda87c0793d47dc8e6c7aa8b5186.tar.gz |
test for #5313
-rw-r--r-- | testsuite/tests/ghc-regress/driver/5313.hs | 18 | ||||
-rw-r--r-- | testsuite/tests/ghc-regress/driver/all.T | 8 |
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/driver/5313.hs b/testsuite/tests/ghc-regress/driver/5313.hs new file mode 100644 index 0000000000..14b809bf7d --- /dev/null +++ b/testsuite/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/testsuite/tests/ghc-regress/driver/all.T b/testsuite/tests/ghc-regress/driver/all.T index b7cc9e2580..2c8d4d9a69 100644 --- a/testsuite/tests/ghc-regress/driver/all.T +++ b/testsuite/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']) |