Remove redundant flag (-O) registration (fixes #13392)
authorSantiago Munin <santimunin@gmail.com>
Mon, 17 Apr 2017 16:44:52 +0000 (12:44 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 18 Apr 2017 00:34:40 +0000 (20:34 -0400)
Reviewers: austin, bgamari, dfeuer

Reviewed By: bgamari, dfeuer

Subscribers: rwbarton, thomie

GHC Trac Issues: #13392

Differential Revision: https://phabricator.haskell.org/D3461

compiler/main/DynFlags.hs
testsuite/tests/driver/T13392/Makefile [new file with mode: 0644]
testsuite/tests/driver/T13392/T13392.stdout [new file with mode: 0644]
testsuite/tests/driver/T13392/all.T [new file with mode: 0644]

index 020ee50..b3600b8 100644 (file)
@@ -3141,7 +3141,6 @@ dynamic_flags_deps = [
   , make_ord_flag defGhcFlag "ffrontend-opt" (hasArg addFrontendPluginOption)
 
         ------ Optimisation flags ------------------------------------------
-  , make_ord_flag defGhcFlag "O"      (noArgM (setOptLevel 1))
   , make_dep_flag defGhcFlag "Onot"   (noArgM $ setOptLevel 0 )
                                                             "Use -O0 instead"
   , make_ord_flag defGhcFlag "Odph"   (noArgM setDPHOpt)
diff --git a/testsuite/tests/driver/T13392/Makefile b/testsuite/tests/driver/T13392/Makefile
new file mode 100644 (file)
index 0000000..9d3c125
--- /dev/null
@@ -0,0 +1,6 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+T13392:
+       '$(TEST_HC)' $(TEST_HC_OPTS) --show-options | sort | uniq -d
diff --git a/testsuite/tests/driver/T13392/T13392.stdout b/testsuite/tests/driver/T13392/T13392.stdout
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/testsuite/tests/driver/T13392/all.T b/testsuite/tests/driver/T13392/all.T
new file mode 100644 (file)
index 0000000..1f2bd40
--- /dev/null
@@ -0,0 +1,3 @@
+# Test for #13392, it makes sure 'ghc --show-options' does not print each flag more than once.
+
+test('T13392', normal, run_command, ['$MAKE -s --no-print-directory T13392'])