Commit de705b80 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #8628

parent 7f2bf06e
......@@ -13,6 +13,10 @@ T8639_api: clean
'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc T8639_api
./T8639_api "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
T8628: clean
'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc T8628
./T8628 "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
.PHONY: clean T6145
module Main where
import System.IO
import DynFlags
import GHC
import Exception
import Module
import FastString
import MonadUtils
import Outputable
import Bag (filterBag,isEmptyBag)
import System.Directory (removeFile)
import System.Environment( getArgs )
import PrelNames
main :: IO()
= do [libdir] <- getArgs
ok <- runGhc (Just libdir) $ do
dflags <- getSessionDynFlags
setSessionDynFlags dflags
liftIO (setUnsafeGlobalDynFlags dflags)
setContext [ IIDecl (simpleImportDecl pRELUDE_NAME)
, IIDecl (simpleImportDecl (mkModuleNameFS (fsLit "System.IO")))]
runDecls "data X = Y ()"
runStmt "print True" RunToCompletion
gtry $ runStmt "print (Y ())" RunToCompletion :: GhcMonad m => m (Either SomeException RunResult)
runDecls "data X = Y () deriving Show"
_ <- dynCompileExpr "'x'"
runStmt "print (Y ())" RunToCompletion
runStmt "System.IO.hFlush System.IO.stdout" RunToCompletion
print "done"
......@@ -5,3 +5,6 @@ test('T6145', when(fast(), skip),
test('T8639_api', when(fast(), skip),
['$MAKE -s --no-print-directory T8639_api'])
test('T8628', when(fast(), skip),
['$MAKE -s --no-print-directory T8628'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment