summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-07-18 15:06:21 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-28 13:56:59 -0400
commitef30e21594e44af309c627052f63aea6fd575c9e (patch)
tree27f09c1ee72a439b017e8252d89e7fc47445d772
parent9ea29d47bbeac7abf54c9c05d105bb6f21d4c083 (diff)
downloadhaskell-ef30e21594e44af309c627052f63aea6fd575c9e.tar.gz
driver: Don't create LinkNodes when -no-link is enabled
Fixes #21866
-rw-r--r--compiler/GHC/Driver/Make.hs2
-rw-r--r--testsuite/tests/driver/T20316.stdout2
-rw-r--r--testsuite/tests/driver/T21866.hs3
-rw-r--r--testsuite/tests/driver/T21866.stderr1
-rw-r--r--testsuite/tests/driver/all.T1
-rw-r--r--testsuite/tests/driver/recomp007/recomp007.stdout2
-rw-r--r--testsuite/tests/driver/retc001/retc001.stdout10
-rw-r--r--testsuite/tests/indexed-types/should_compile/impexp.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T6018fail.stderr10
9 files changed, 20 insertions, 15 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index 1968bfa954..dd0c21a990 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -299,7 +299,7 @@ linkNodes summaries uid hue =
in if | ghcLink dflags == LinkBinary && isJust ofile && not do_linking ->
Just (Left $ singleMessage $ mkPlainErrorMsgEnvelope noSrcSpan (DriverRedirectedNoMain $ mainModuleNameIs dflags))
-- This should be an error, not a warning (#10895).
- | do_linking -> Just (Right (LinkNode unit_nodes uid))
+ | ghcLink dflags /= NoLink, do_linking -> Just (Right (LinkNode unit_nodes uid))
| otherwise -> Nothing
-- Note [Missing home modules]
diff --git a/testsuite/tests/driver/T20316.stdout b/testsuite/tests/driver/T20316.stdout
index f46d4f0715..280a3c80e7 100644
--- a/testsuite/tests/driver/T20316.stdout
+++ b/testsuite/tests/driver/T20316.stdout
@@ -1,4 +1,4 @@
-[1 of 2] Compiling Main ( T20316.hs, nothing )
+[1 of 1] Compiling Main ( T20316.hs, nothing )
*** non-module.dump-timings ***
initializing unit database:
Chasing dependencies:
diff --git a/testsuite/tests/driver/T21866.hs b/testsuite/tests/driver/T21866.hs
new file mode 100644
index 0000000000..918e213f57
--- /dev/null
+++ b/testsuite/tests/driver/T21866.hs
@@ -0,0 +1,3 @@
+module Main where
+
+main = print ()
diff --git a/testsuite/tests/driver/T21866.stderr b/testsuite/tests/driver/T21866.stderr
new file mode 100644
index 0000000000..a8671daaca
--- /dev/null
+++ b/testsuite/tests/driver/T21866.stderr
@@ -0,0 +1 @@
+[1 of 1] Compiling Main ( T21866.hs, T21866.o )
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 8f94bd3c1f..e57a6e2292 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -308,5 +308,6 @@ test('patch-level2', normal, compile, ['-Wcpp-undef'])
test('T16476a', normal, makefile_test, [])
test('T16476b', normal, makefile_test, [])
test('T20569', extra_files(["T20569/"]), makefile_test, [])
+test('T21866', normal, multimod_compile, ['T21866','-no-link'])
test('T21349', extra_files(['T21349']), makefile_test, [])
test('T21869', [normal, when(unregisterised(), skip)], makefile_test, [])
diff --git a/testsuite/tests/driver/recomp007/recomp007.stdout b/testsuite/tests/driver/recomp007/recomp007.stdout
index c6b194ef17..cbb1b0670b 100644
--- a/testsuite/tests/driver/recomp007/recomp007.stdout
+++ b/testsuite/tests/driver/recomp007/recomp007.stdout
@@ -1,6 +1,6 @@
"1.0"
Preprocessing executable 'test' for b-1.0..
Building executable 'test' for b-1.0..
-[1 of 3] Compiling B ( B.hs, dist/build/test/test-tmp/B.o ) [A package changed]
+[1 of 2] Compiling B ( B.hs, dist/build/test/test-tmp/B.o ) [A package changed]
[3 of 3] Linking dist/build/test/test [Objects changed]
"2.0"
diff --git a/testsuite/tests/driver/retc001/retc001.stdout b/testsuite/tests/driver/retc001/retc001.stdout
index a5bdd0597e..e5d374608e 100644
--- a/testsuite/tests/driver/retc001/retc001.stdout
+++ b/testsuite/tests/driver/retc001/retc001.stdout
@@ -1,7 +1,7 @@
-[1 of 4] Compiling A ( A.hs, nothing )
-[2 of 4] Compiling B ( B.hs, nothing )
-[3 of 4] Compiling Main ( C.hs, nothing )
+[1 of 3] Compiling A ( A.hs, nothing )
+[2 of 3] Compiling B ( B.hs, nothing )
+[3 of 3] Compiling Main ( C.hs, nothing )
Middle
End
-[2 of 4] Compiling B ( B.hs, nothing ) [Source file changed]
-[3 of 4] Compiling Main ( C.hs, nothing ) [B changed]
+[2 of 3] Compiling B ( B.hs, nothing ) [Source file changed]
+[3 of 3] Compiling Main ( C.hs, nothing ) [B changed]
diff --git a/testsuite/tests/indexed-types/should_compile/impexp.stderr b/testsuite/tests/indexed-types/should_compile/impexp.stderr
index c57f611d6f..7ebebe9e03 100644
--- a/testsuite/tests/indexed-types/should_compile/impexp.stderr
+++ b/testsuite/tests/indexed-types/should_compile/impexp.stderr
@@ -1,2 +1,2 @@
-[1 of 3] Compiling Exp ( Exp.hs, Exp.o )
-[2 of 3] Compiling Imp ( Imp.hs, Imp.o )
+[1 of 2] Compiling Exp ( Exp.hs, Exp.o )
+[2 of 2] Compiling Imp ( Imp.hs, Imp.o )
diff --git a/testsuite/tests/typecheck/should_fail/T6018fail.stderr b/testsuite/tests/typecheck/should_fail/T6018fail.stderr
index ed1a8c3de2..78a92e7d1b 100644
--- a/testsuite/tests/typecheck/should_fail/T6018fail.stderr
+++ b/testsuite/tests/typecheck/should_fail/T6018fail.stderr
@@ -1,8 +1,8 @@
-[1 of 6] Compiling T6018Afail ( T6018Afail.hs, T6018Afail.o )
-[2 of 6] Compiling T6018Bfail ( T6018Bfail.hs, T6018Bfail.o )
-[3 of 6] Compiling T6018Cfail ( T6018Cfail.hs, T6018Cfail.o )
-[4 of 6] Compiling T6018Dfail ( T6018Dfail.hs, T6018Dfail.o )
-[5 of 6] Compiling T6018fail ( T6018fail.hs, T6018fail.o )
+[1 of 5] Compiling T6018Afail ( T6018Afail.hs, T6018Afail.o )
+[2 of 5] Compiling T6018Bfail ( T6018Bfail.hs, T6018Bfail.o )
+[3 of 5] Compiling T6018Cfail ( T6018Cfail.hs, T6018Cfail.o )
+[4 of 5] Compiling T6018Dfail ( T6018Dfail.hs, T6018Dfail.o )
+[5 of 5] Compiling T6018fail ( T6018fail.hs, T6018fail.o )
T6018fail.hs:15:15: error:
Type family equation right-hand sides overlap; this violates