summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantiago Munin <santimunin@gmail.com>2017-04-17 12:44:52 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-17 20:34:40 -0400
commitb894f02058a10b5b0a4074020feae2771e793577 (patch)
tree067ab39c4e2d29e2cee221f48c28fb1c1691c88c
parent5a210032d4b9dcc644a5557eb4144445f660ea27 (diff)
downloadhaskell-b894f02058a10b5b0a4074020feae2771e793577.tar.gz
Remove redundant flag (-O) registration (fixes #13392)
Reviewers: austin, bgamari, dfeuer Reviewed By: bgamari, dfeuer Subscribers: rwbarton, thomie GHC Trac Issues: #13392 Differential Revision: https://phabricator.haskell.org/D3461
-rw-r--r--compiler/main/DynFlags.hs1
-rw-r--r--testsuite/tests/driver/T13392/Makefile6
-rw-r--r--testsuite/tests/driver/T13392/T13392.stdout0
-rw-r--r--testsuite/tests/driver/T13392/all.T3
4 files changed, 9 insertions, 1 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 020ee50891..b3600b8cfb 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -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
index 0000000000..9d3c1250a3
--- /dev/null
+++ b/testsuite/tests/driver/T13392/Makefile
@@ -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
index 0000000000..e69de29bb2
--- /dev/null
+++ b/testsuite/tests/driver/T13392/T13392.stdout
diff --git a/testsuite/tests/driver/T13392/all.T b/testsuite/tests/driver/T13392/all.T
new file mode 100644
index 0000000000..1f2bd40a10
--- /dev/null
+++ b/testsuite/tests/driver/T13392/all.T
@@ -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'])