diff options
Diffstat (limited to 'testsuite/tests')
3 files changed, 20 insertions, 1 deletions
diff --git a/testsuite/tests/plugins/T16104-plugin/T16104_Plugin.hs b/testsuite/tests/plugins/T16104-plugin/T16104_Plugin.hs index c85b4ca395..7615a3c69e 100644 --- a/testsuite/tests/plugins/T16104-plugin/T16104_Plugin.hs +++ b/testsuite/tests/plugins/T16104-plugin/T16104_Plugin.hs @@ -4,6 +4,7 @@ module T16104_Plugin (plugin) where import GHC.Plugins import Data.Bits +import System.IO plugin :: Plugin plugin = defaultPlugin {installCoreToDos = install} @@ -14,7 +15,10 @@ plugin = defaultPlugin {installCoreToDos = install} check :: ModGuts -> CoreM ModGuts check m = do mbN <- thNameToGhcName 'complement case mbN of - Just _ -> liftIO $ putStrLn "Found complement!" + Just _ -> do + liftIO $ putStrLn "Found complement!" + -- TODO: Remove #20791 + liftIO $ hFlush stdout Nothing -> error "Failed to locate complement" return m diff --git a/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs index 0a9ef301d6..bb0458bf3e 100644 --- a/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs +++ b/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs @@ -15,6 +15,7 @@ import GHC.Utils.Outputable import GHC.Hs.ImpExp import GHC.Hs.Decls import GHC.Hs.Doc +import System.IO plugin :: Plugin plugin = defaultPlugin { parsedResultAction = parsedPlugin @@ -28,6 +29,8 @@ parsedPlugin :: [CommandLineOption] -> ModSummary -> HsParsedModule -> Hsc HsParsedModule parsedPlugin opts _ pm = do liftIO $ putStrLn $ "parsePlugin(" ++ intercalate "," opts ++ ")" + -- TODO: Remove #20791 + liftIO $ hFlush stdout return pm renamedAction :: [CommandLineOption] @@ -35,17 +38,24 @@ renamedAction :: [CommandLineOption] -> TcM (TcGblEnv, HsGroup GhcRn) renamedAction _ env grp = do liftIO $ putStrLn "typeCheckPlugin (rn)" + -- TODO: Remove #20791 + liftIO $ hFlush stdout return (env, grp) typecheckPlugin :: [CommandLineOption] -> ModSummary -> TcGblEnv -> TcM TcGblEnv typecheckPlugin _ _ tc = do liftIO $ putStrLn "typeCheckPlugin (tc)" + -- TODO: Remove #20791 + liftIO $ hFlush stdout return tc metaPlugin' :: [CommandLineOption] -> LHsExpr GhcTc -> TcM (LHsExpr GhcTc) metaPlugin' _ meta = do dflags <- getDynFlags liftIO $ putStrLn $ "metaPlugin: " ++ (showSDoc dflags $ ppr meta) + -- TODO: Remove #20791 + liftIO $ hFlush stdout + return meta interfaceLoadPlugin' :: [CommandLineOption] -> ModIface -> IfM lcl ModIface @@ -53,4 +63,6 @@ interfaceLoadPlugin' _ iface = do dflags <- getDynFlags liftIO $ putStrLn $ "interfacePlugin: " ++ (showSDoc dflags $ ppr $ mi_module iface) + -- TODO: Remove #20791 + liftIO $ hFlush stdout return iface diff --git a/testsuite/tests/plugins/simple-plugin/Simple/TrustworthyPlugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/TrustworthyPlugin.hs index ecf509e40e..802a05803a 100644 --- a/testsuite/tests/plugins/simple-plugin/Simple/TrustworthyPlugin.hs +++ b/testsuite/tests/plugins/simple-plugin/Simple/TrustworthyPlugin.hs @@ -2,6 +2,7 @@ module Simple.TrustworthyPlugin (plugin) where import GHC.Plugins import GHC.Tc.Utils.Monad +import System.IO plugin :: Plugin plugin = defaultPlugin @@ -14,4 +15,6 @@ plugin = defaultPlugin safe <- finalSafeMode dflags tcg print $ gopt Opt_PluginTrustworthy dflags putStrLn $ showPpr dflags safe + -- TODO: Remove #20791 + hFlush stdout return tcg |