summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-06-04 18:01:54 -0400
committerBen Gamari <ben@smart-cactus.org>2019-06-04 18:01:54 -0400
commita91acd25e4ca1ac86c9700ef45e3ba4d29c643c5 (patch)
tree5c8be68c5982dde080bc5ff712d7961d5f5d9719
parent32ae6b2a23201c3efd1cee5a68edd68f9d45bddf (diff)
parent0b91a0292b63fbe7f620b6b005efa480d20adb3e (diff)
downloadhaskell-a91acd25e4ca1ac86c9700ef45e3ba4d29c643c5.tar.gz
Merge remote-tracking branch 'origin/cherry-pick-43a43a33' into wip/ghc-8.8-merges
-rw-r--r--compiler/main/GhcMake.hs4
-rw-r--r--testsuite/tests/warnings/should_compile/T16551.stderr3
-rw-r--r--testsuite/tests/warnings/should_compile/T16551/A.hs2
-rw-r--r--testsuite/tests/warnings/should_compile/T16551/B.hs2
-rw-r--r--testsuite/tests/warnings/should_compile/T16551/B.hs-boot1
-rw-r--r--testsuite/tests/warnings/should_compile/all.T1
6 files changed, 13 insertions, 0 deletions
diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs
index d5f58f8f9b..aa9f01d25a 100644
--- a/compiler/main/GhcMake.hs
+++ b/compiler/main/GhcMake.hs
@@ -184,6 +184,10 @@ warnMissingHomeModules hsc_env mod_graph =
is_my_target mod (TargetFile target_file _)
| Just mod_file <- ml_hs_file (ms_location mod)
= target_file == mod_file ||
+
+ -- Don't warn on B.hs-boot if B.hs is specified (#16551)
+ addBootSuffix target_file == mod_file ||
+
-- We can get a file target even if a module name was
-- originally specified in a command line because it can
-- be converted in guessTarget (by appending .hs/.lhs).
diff --git a/testsuite/tests/warnings/should_compile/T16551.stderr b/testsuite/tests/warnings/should_compile/T16551.stderr
new file mode 100644
index 0000000000..352784c7d6
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T16551.stderr
@@ -0,0 +1,3 @@
+[1 of 3] Compiling B[boot] ( T16551/B.hs-boot, T16551/B.o-boot )
+[2 of 3] Compiling A ( T16551/A.hs, T16551/A.o )
+[3 of 3] Compiling B ( T16551/B.hs, T16551/B.o )
diff --git a/testsuite/tests/warnings/should_compile/T16551/A.hs b/testsuite/tests/warnings/should_compile/T16551/A.hs
new file mode 100644
index 0000000000..138a4faa1c
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T16551/A.hs
@@ -0,0 +1,2 @@
+module A where
+import {-# SOURCE #-} B
diff --git a/testsuite/tests/warnings/should_compile/T16551/B.hs b/testsuite/tests/warnings/should_compile/T16551/B.hs
new file mode 100644
index 0000000000..af11916966
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T16551/B.hs
@@ -0,0 +1,2 @@
+module B where
+import A
diff --git a/testsuite/tests/warnings/should_compile/T16551/B.hs-boot b/testsuite/tests/warnings/should_compile/T16551/B.hs-boot
new file mode 100644
index 0000000000..c759bc2d13
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T16551/B.hs-boot
@@ -0,0 +1 @@
+module B where
diff --git a/testsuite/tests/warnings/should_compile/all.T b/testsuite/tests/warnings/should_compile/all.T
index 36e6b1beeb..fcf03443d3 100644
--- a/testsuite/tests/warnings/should_compile/all.T
+++ b/testsuite/tests/warnings/should_compile/all.T
@@ -22,6 +22,7 @@ test('Werror01', normal, compile, [''])
test('Werror02', normal, compile, [''])
test('MissingMod', normal, multimod_compile, ['MissingMod', '-Wmissing-home-modules'])
+test('T16551', [extra_files(['T16551/'])], multimod_compile, ['T16551/A.hs T16551/B.hs', '-Wmissing-home-modules'])
test('StarBinder', normal, compile, [''])