summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-12-05 10:12:09 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2018-12-05 10:15:40 +0000
commit84cba4bce65ffc99e2356b3621cf91258b055cad (patch)
treeeb30ca74bf730a1aa9534adc64c1c47f23e7a4b6 /testsuite/tests/rename
parenta8b7cef4d45a5003bf7584e06912f0f632116c71 (diff)
downloadhaskell-84cba4bce65ffc99e2356b3621cf91258b055cad.tar.gz
Remove duplicates in -ddump-minimial-imports
This fixes Trac #15994. Previously RdrName.gresToAvailInfo assumed that the input list of GREs had no duplicates. I accidentally broke this precondition in this refactoring: commit 6353efc7694ba8ec86c091918e02595662169ae2 Date: Thu Nov 22 14:48:05 2018 -0500 Fix unused-import warnings This patch fixes a fairly long-standing bug (dating back to 2015) in RdrName.bestImport, namely (There was an ASSERT, but it's usually switched off in stage2. It tripped when I switched stage2 assertions on.) The fix is straightforward: account for dups in gresToAvailInfo.
Diffstat (limited to 'testsuite/tests/rename')
-rw-r--r--testsuite/tests/rename/should_compile/Makefile7
-rw-r--r--testsuite/tests/rename/should_compile/T15994.hs5
-rw-r--r--testsuite/tests/rename/should_compile/T15994.stdout1
-rw-r--r--testsuite/tests/rename/should_compile/all.T1
4 files changed, 13 insertions, 1 deletions
diff --git a/testsuite/tests/rename/should_compile/Makefile b/testsuite/tests/rename/should_compile/Makefile
index 69e899b7dd..6e41534ca8 100644
--- a/testsuite/tests/rename/should_compile/Makefile
+++ b/testsuite/tests/rename/should_compile/Makefile
@@ -27,12 +27,17 @@ T3449:
'$(TEST_HC)' $(TEST_HC_OPTS) -Wall -c T3449.hs
T4239:
- $(RM) T4239A.hi T4239A.o
+ $(RM) TT4239A.hi T4239A.o
$(RM) T4239.hi T4239.o T4239.imports
'$(TEST_HC)' $(TEST_HC_OPTS) -c T4239A.hs
'$(TEST_HC)' $(TEST_HC_OPTS) -c T4239.hs -ddump-minimal-imports
cat T4239.imports
+T15994:
+ $(RM) T15994.hi T15994.o T15994.imports
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c T15994.hs -ddump-minimal-imports
+ cat T15994.imports
+
T4240:
$(RM) T4240A.hi T4240A.o
$(RM) T4240B.hi T4240B.o
diff --git a/testsuite/tests/rename/should_compile/T15994.hs b/testsuite/tests/rename/should_compile/T15994.hs
new file mode 100644
index 0000000000..ff7c56f65c
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T15994.hs
@@ -0,0 +1,5 @@
+module T15994 where
+
+import System.IO
+
+f = [ReadMode, ReadMode]
diff --git a/testsuite/tests/rename/should_compile/T15994.stdout b/testsuite/tests/rename/should_compile/T15994.stdout
new file mode 100644
index 0000000000..329734980c
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T15994.stdout
@@ -0,0 +1 @@
+import System.IO ( IOMode(ReadMode) )
diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T
index 86f04d0ea9..b6c06c151c 100644
--- a/testsuite/tests/rename/should_compile/all.T
+++ b/testsuite/tests/rename/should_compile/all.T
@@ -162,3 +162,4 @@ test('T14487', [], multimod_compile, ['T14487', '-v0'])
test('T14747', [], multimod_compile, ['T14747', '-v0'])
test('T15149', [], multimod_compile, ['T15149', '-v0'])
test('T13064', normal, compile, [''])
+test('T15994', [], run_command, ['$MAKE -s --no-print-directory T15994'])