summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-03-31 12:11:08 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2015-03-31 12:11:16 +0200
commit9e073ce41ff471d0b734ace095ece2a3e4c02f68 (patch)
treeb35b1a80c0bfcee4d58bd525702ec6d381137c55
parenta3d0a7a0ba3a1ee458a9883011247561dfe22f4a (diff)
downloadhaskell-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.hs7
-rw-r--r--testsuite/tests/driver/T7563.stderr2
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.