diff options
author | Ian Lynagh <igloo@earth.li> | 2011-10-05 19:17:20 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-10-05 19:17:20 +0100 |
commit | b80cc02525a43c7a3fba85bb03e8acbd28211f57 (patch) | |
tree | 85ea604381184237b935bf07e165af8fe697dafc /testsuite | |
parent | a40f26b29c4f6cf2100d4139a87b1de077661d6e (diff) | |
download | haskell-b80cc02525a43c7a3fba85bb03e8acbd28211f57.tar.gz |
Add a test for dynCompileExpr
Diffstat (limited to 'testsuite')
4 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-api/dynCompileExpr/Makefile b/testsuite/tests/ghc-api/dynCompileExpr/Makefile new file mode 100644 index 0000000000..8ed1da5153 --- /dev/null +++ b/testsuite/tests/ghc-api/dynCompileExpr/Makefile @@ -0,0 +1,13 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +clean: + rm -f *.o *.hi + +dynCompileExpr: clean + '$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc dynCompileExpr + ./dynCompileExpr "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" + +.PHONY: clean dynCompileExpr + diff --git a/testsuite/tests/ghc-api/dynCompileExpr/all.T b/testsuite/tests/ghc-api/dynCompileExpr/all.T new file mode 100644 index 0000000000..57962cfdf1 --- /dev/null +++ b/testsuite/tests/ghc-api/dynCompileExpr/all.T @@ -0,0 +1,4 @@ +test('dynCompileExpr', + normal, + run_command, + ['$MAKE -s --no-print-directory dynCompileExpr']) diff --git a/testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.hs b/testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.hs new file mode 100644 index 0000000000..9cdd3f0b7d --- /dev/null +++ b/testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.hs @@ -0,0 +1,18 @@ + +module Main where + +import GHC +import MonadUtils + +import System.Environment + +main :: IO () +main = do [libdir] <- getArgs + runGhc (Just libdir) doit + +doit :: Ghc () +doit = do + getSessionDynFlags >>= setSessionDynFlags + dyn <- dynCompileExpr "()" + liftIO $ print dyn + diff --git a/testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.stdout b/testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.stdout new file mode 100644 index 0000000000..e5f4ec87a4 --- /dev/null +++ b/testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.stdout @@ -0,0 +1 @@ +<<()>> |