summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-09-27 10:28:43 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-09-27 19:15:12 +0000
commit2fd70719ab849fe22df939bc32005b2a6860c709 (patch)
treeaf08fc4409cfedabfd9d94662d2cd795c522a160
parent8127520ee20e0ba8f7c8bfc84818781b9af652ae (diff)
downloadhaskell-wip/t20416.tar.gz
driver: Fix -E -XCPP, copy output from CPP ouput rather than .hs outputwip/t20416
Fixes #20416 I thought about adding a test for this case but I struggled to think of something robust. Grepping -v3 will include different paths on different systems and the structure of the result file depends on which preprocessor you are using.
-rw-r--r--compiler/GHC/Driver/Pipeline.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs
index 4f27c99d26..8362af9423 100644
--- a/compiler/GHC/Driver/Pipeline.hs
+++ b/compiler/GHC/Driver/Pipeline.hs
@@ -904,10 +904,10 @@ pipelineStart pipe_env hsc_env input_fn =
-- File name we expected the output to have
final_fn <- liftIO $ phaseOutputFilenameNew (Hsc HsSrcFile) pipe_env hsc_env Nothing
when (final_fn /= out_fn) $ do
- let msg = "Copying `" ++ input_fn ++"' to `" ++ final_fn ++ "'"
+ let msg = "Copying `" ++ out_fn ++"' to `" ++ final_fn ++ "'"
line_prag = "{-# LINE 1 \"" ++ src_filename pipe_env ++ "\" #-}\n"
liftIO (showPass logger msg)
- liftIO (copyWithHeader line_prag input_fn final_fn)
+ liftIO (copyWithHeader line_prag out_fn final_fn)
return Nothing
_ -> objFromLinkable <$> fullPipeline pipe_env hsc_env input_fn sf
c :: P m => Phase -> m (Maybe FilePath)