[commit: ghc] master: Explicitly check for -C on registerised build (#7563) (9e073ce)

git at git.haskell.org git at git.haskell.org
Tue Mar 31 10:11:26 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9e073ce41ff471d0b734ace095ece2a3e4c02f68/ghc

>---------------------------------------------------------------

commit 9e073ce41ff471d0b734ace095ece2a3e4c02f68
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Tue Mar 31 12:11:08 2015 +0200

    Explicitly check for -C on registerised build (#7563)
    
    Show a more descriptive error message.
    
    Reviewed By: austin
    
    Differential Revision: https://phabricator.haskell.org/D775


>---------------------------------------------------------------

9e073ce41ff471d0b734ace095ece2a3e4c02f68
 ghc/Main.hs                         | 7 ++++++-
 testsuite/tests/driver/T7563.stderr | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ghc/Main.hs b/ghc/Main.hs
index a91fb26..2f013aa 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -339,10 +339,15 @@ checkOptions mode dflags srcs objs = do
         then throwGhcException (UsageError "no input files")
         else do
 
+   case mode of
+      StopBefore HCc | hscTarget dflags /= HscC
+        -> throwGhcException $ UsageError $
+           "the option -C is only available with an unregisterised GHC"
+      _ -> return ()
+
      -- Verify that output files point somewhere sensible.
    verifyOutputFiles dflags
 
-
 -- Compiler output options
 
 -- Called to verify that the output files point somewhere valid.
diff --git a/testsuite/tests/driver/T7563.stderr b/testsuite/tests/driver/T7563.stderr
index d9d296f..316e2c0 100644
--- a/testsuite/tests/driver/T7563.stderr
+++ b/testsuite/tests/driver/T7563.stderr
@@ -1,2 +1,2 @@
-ghc: cannot compile this file to desired target: T7563.hs
+ghc-stage2: the option -C is only available with an unregisterised GHC
 Usage: For basic information, try the `--help' option.



More information about the ghc-commits mailing list