diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2015-03-31 12:11:08 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2015-03-31 12:11:16 +0200 |
commit | 9e073ce41ff471d0b734ace095ece2a3e4c02f68 (patch) | |
tree | b35b1a80c0bfcee4d58bd525702ec6d381137c55 | |
parent | a3d0a7a0ba3a1ee458a9883011247561dfe22f4a (diff) | |
download | haskell-9e073ce41ff471d0b734ace095ece2a3e4c02f68.tar.gz |
Explicitly check for -C on registerised build (#7563)
Show a more descriptive error message.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D775
-rw-r--r-- | ghc/Main.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/driver/T7563.stderr | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs index a91fb26af7..2f013aa76e 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 d9d296f3c3..316e2c0858 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. |