diff options
Diffstat (limited to 'testsuite/tests/ghc-api/downsweep/OldModLocation.hs')
-rw-r--r-- | testsuite/tests/ghc-api/downsweep/OldModLocation.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/testsuite/tests/ghc-api/downsweep/OldModLocation.hs b/testsuite/tests/ghc-api/downsweep/OldModLocation.hs index ca1740358f..cf9b1f475d 100644 --- a/testsuite/tests/ghc-api/downsweep/OldModLocation.hs +++ b/testsuite/tests/ghc-api/downsweep/OldModLocation.hs @@ -6,12 +6,13 @@ import GHC import GHC.Driver.Make import GHC.Driver.Session import GHC.Driver.Env -import GHC.Unit.Module.ModSummary (ExtendedModSummary(..)) +import GHC.Unit.Module.Graph import GHC.Unit.Finder import Control.Monad.IO.Class (liftIO) import Data.List (sort, stripPrefix) import Data.Either +import Data.Maybe import System.Environment import System.Directory @@ -48,18 +49,18 @@ main = do _emss <- downsweep hsc_env [] [] False - flushFinderCaches (hsc_FC hsc_env) (hsc_home_unit hsc_env) + flushFinderCaches (hsc_FC hsc_env) (hsc_unit_env hsc_env) createDirectoryIfMissing False "mydir" renameFile "B.hs" "mydir/B.hs" - emss <- downsweep hsc_env [] [] False + (_, nodes) <- downsweep hsc_env [] [] False -- If 'checkSummaryTimestamp' were to call 'addHomeModuleToFinder' with -- (ms_location old_summary) like summariseFile used to instead of -- using the 'location' parameter we'd end up using the old location of -- the "B" module in this test. Make sure that doesn't happen. - hPrint stderr $ sort (map (ml_hs_file . ms_location) (map emsModSummary (rights emss))) + hPrint stderr $ sort (map (ml_hs_file . ms_location) (mapMaybe moduleGraphNodeModule nodes)) writeMod :: [String] -> IO () writeMod src@(head -> stripPrefix "module " -> Just (takeWhile (/=' ') -> mod)) |