diff options
Diffstat (limited to 'testsuite/tests/regalloc')
-rw-r--r-- | testsuite/tests/regalloc/regalloc_unit_tests.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/testsuite/tests/regalloc/regalloc_unit_tests.hs b/testsuite/tests/regalloc/regalloc_unit_tests.hs index afc6fa0fca..cc4dcf7f9b 100644 --- a/testsuite/tests/regalloc/regalloc_unit_tests.hs +++ b/testsuite/tests/regalloc/regalloc_unit_tests.hs @@ -46,6 +46,7 @@ import GHC.Driver.Errors import GHC.Utils.Error import GHC.Utils.Outputable import GHC.Types.Basic +import GHC.Unit.Home import GHC.Data.Stream as Stream (collect, yield) @@ -114,7 +115,8 @@ compileCmmForRegAllocStats logger dflags' cmmFile ncgImplF us = do hscEnv <- newHscEnv dflags -- parse the cmm file and output any warnings or errors - (warnings, errors, parsedCmm) <- parseCmmFile dflags (hsc_home_unit hscEnv) cmmFile + let fake_mod = mkHomeModule (hsc_home_unit hscEnv) (mkModuleName "fake") + (warnings, errors, parsedCmm) <- parseCmmFile dflags fake_mod (hsc_home_unit hscEnv) cmmFile let warningMsgs = fmap pprWarning warnings errorMsgs = fmap pprError errors @@ -122,7 +124,7 @@ compileCmmForRegAllocStats logger dflags' cmmFile ncgImplF us = do mapM_ (printBagOfErrors logger dflags) [warningMsgs, errorMsgs] let initTopSRT = emptySRT thisMod - cmmGroup <- fmap snd $ cmmPipeline hscEnv initTopSRT $ fromJust parsedCmm + cmmGroup <- fmap snd $ cmmPipeline hscEnv initTopSRT $ fst $ fromJust parsedCmm rawCmms <- cmmToRawCmm logger dflags (Stream.yield cmmGroup) |