[commit: ghc] master: compiler/main: fixes #9776 (80f6fc1)

git at git.haskell.org git at git.haskell.org
Wed Nov 19 23:09:45 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/80f6fc1769296330687d54179a6dc149f02d6348/ghc

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

commit 80f6fc1769296330687d54179a6dc149f02d6348
Author: Carlos Tomé <carlostome1990 at gmail.com>
Date:   Wed Nov 19 17:07:53 2014 -0600

    compiler/main: fixes #9776
    
    Test Plan: test T9776 under tests/driver
    
    Reviewers: jstolarek, austin
    
    Reviewed By: jstolarek, austin
    
    Subscribers: jstolarek, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D503
    
    GHC Trac Issues: #9776


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

80f6fc1769296330687d54179a6dc149f02d6348
 compiler/main/CmdLineParser.hs      | 3 ++-
 testsuite/tests/driver/T9776.hs     | 1 +
 testsuite/tests/driver/T9776.stderr | 2 ++
 testsuite/tests/driver/all.T        | 3 +++
 4 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/compiler/main/CmdLineParser.hs b/compiler/main/CmdLineParser.hs
index 7d7bbfe..a4b9118 100644
--- a/compiler/main/CmdLineParser.hs
+++ b/compiler/main/CmdLineParser.hs
@@ -191,8 +191,9 @@ processOneArg opt_kind rest arg args
                                     []               -> missingArgErr dash_arg
                                     (L _ arg1:args1) -> Right (f arg1, args1)
 
+        -- See Trac #9776
         SepArg f -> case args of
-                        []               -> unknownFlagErr dash_arg
+                        []               -> missingArgErr dash_arg
                         (L _ arg1:args1) -> Right (f arg1, args1)
 
         Prefix f | notNull rest_no_eq -> Right (f rest_no_eq, args)
diff --git a/testsuite/tests/driver/T9776.hs b/testsuite/tests/driver/T9776.hs
new file mode 100644
index 0000000..28551cf
--- /dev/null
+++ b/testsuite/tests/driver/T9776.hs
@@ -0,0 +1 @@
+module T9776 where
diff --git a/testsuite/tests/driver/T9776.stderr b/testsuite/tests/driver/T9776.stderr
new file mode 100644
index 0000000..328a105
--- /dev/null
+++ b/testsuite/tests/driver/T9776.stderr
@@ -0,0 +1,2 @@
+ghc-stage2: on the commandline: missing argument for flag: -frule-check
+Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 7236ec1..f2c58d1 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -406,3 +406,6 @@ test('T9050', normal, build_T9050, [])
 
 test('write_interface_oneshot', normal, run_command, ['$MAKE -s --no-print-directory write_interface_oneshot'])
 test('write_interface_make', normal, run_command, ['$MAKE -s --no-print-directory write_interface_make'])
+
+test('T9776', normal, compile_fail, ['-frule-check'])
+



More information about the ghc-commits mailing list