summaryrefslogtreecommitdiff
path: root/testsuite/tests/warnings
diff options
context:
space:
mode:
authorYuras Shumovich <shumovichy@gmail.com>2019-01-20 19:49:56 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-11 18:39:58 -0400
commitfe7e7e4a950a77326cc16f4ade30a67d20d7cdd5 (patch)
tree49e25ca769f6a66240c5960a59a411175a7241d7 /testsuite/tests/warnings
parente5d275f45677ed89df310754973a15c522dc1003 (diff)
downloadhaskell-fe7e7e4a950a77326cc16f4ade30a67d20d7cdd5.tar.gz
Warn about unused packages
Reviewers: bgamari, simonpj Reviewed By: simonpj Subscribers: hvr, simonpj, mpickering, rwbarton, carter GHC Trac Issues: #15838 Differential Revision: https://phabricator.haskell.org/D5285
Diffstat (limited to 'testsuite/tests/warnings')
-rw-r--r--testsuite/tests/warnings/should_compile/UnusedPackages.hs5
-rw-r--r--testsuite/tests/warnings/should_compile/UnusedPackages.stderr6
-rw-r--r--testsuite/tests/warnings/should_compile/all.T2
3 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/warnings/should_compile/UnusedPackages.hs b/testsuite/tests/warnings/should_compile/UnusedPackages.hs
new file mode 100644
index 0000000000..ef70dbb084
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/UnusedPackages.hs
@@ -0,0 +1,5 @@
+module Main
+where
+
+main :: IO ()
+main = return ()
diff --git a/testsuite/tests/warnings/should_compile/UnusedPackages.stderr b/testsuite/tests/warnings/should_compile/UnusedPackages.stderr
new file mode 100644
index 0000000000..7660287aa8
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/UnusedPackages.stderr
@@ -0,0 +1,6 @@
+[1 of 1] Compiling Main ( UnusedPackages.hs, UnusedPackages.o )
+Linking UnusedPackages ...
+
+<no location info>: warning: [-Wunused-packages]
+ The following packages were specified via -package or -package-id flags, but were not needed for compilation:
+ bytestring
diff --git a/testsuite/tests/warnings/should_compile/all.T b/testsuite/tests/warnings/should_compile/all.T
index fcf03443d3..55dee873ae 100644
--- a/testsuite/tests/warnings/should_compile/all.T
+++ b/testsuite/tests/warnings/should_compile/all.T
@@ -27,3 +27,5 @@ test('T16551', [extra_files(['T16551/'])], multimod_compile, ['T16551/A.hs T1655
test('StarBinder', normal, compile, [''])
test('Overflow', normal, compile, [''])
+
+test('UnusedPackages', normal, multimod_compile, ['UnusedPackages.hs', '-package=bytestring -package=base -Wunused-packages'])