diff options
author | adithyaov <adi.obilisetty@gmail.com> | 2019-10-07 03:54:09 +0530 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-16 07:05:01 -0400 |
commit | cc2bda505893a65fdc118cb4ccb1c6325dfcc633 (patch) | |
tree | 8813a2d0fb98b688ec2c530d686e56d9c813ecb2 | |
parent | 535a88e1f348112c44e27e0083a68f054b055619 (diff) | |
download | haskell-cc2bda505893a65fdc118cb4ccb1c6325dfcc633.tar.gz |
Compiling with -S and -fno-code no longer panics (fixes #17143)
-rw-r--r-- | ghc/Main.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/driver/T17143.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/driver/T17143.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/driver/all.T | 2 |
4 files changed, 10 insertions, 0 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs index 4cdf3ecb94..b66f567d2f 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -385,6 +385,10 @@ checkOptions mode dflags srcs objs = do StopBefore HCc | hscTarget dflags /= HscC -> throwGhcException $ UsageError $ "the option -C is only available with an unregisterised GHC" + StopBefore (As False) | ghcLink dflags == NoLink + -> throwGhcException $ UsageError $ + "the options -S and -fno-code are incompatible. Please omit -S" + _ -> return () -- Verify that output files point somewhere sensible. diff --git a/testsuite/tests/driver/T17143.hs b/testsuite/tests/driver/T17143.hs new file mode 100644 index 0000000000..d61ecb5dc7 --- /dev/null +++ b/testsuite/tests/driver/T17143.hs @@ -0,0 +1,2 @@ + +main = print "Hello world" diff --git a/testsuite/tests/driver/T17143.stderr b/testsuite/tests/driver/T17143.stderr new file mode 100644 index 0000000000..9573467e84 --- /dev/null +++ b/testsuite/tests/driver/T17143.stderr @@ -0,0 +1,2 @@ +ghc: the options -S and -fno-code are incompatible. Please omit -S +Usage: For basic information, try the `--help' option.
\ No newline at end of file diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 370e360fc0..239a70d2ba 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -277,3 +277,5 @@ test('T16737', req_th, expect_broken_for(16541, ['ghci'])], compile_and_run, ['-optP=-isystem -optP=T16737include']) + +test('T17143', exit_code(1), run_command, ['{compiler} T17143.hs -S -fno-code'])
\ No newline at end of file |