summaryrefslogtreecommitdiff
path: root/testsuite/tests/warnings
diff options
context:
space:
mode:
authorEric Crockett <ecrockett0@gmail.com>2019-04-07 15:21:59 -0400
committerBen Gamari <ben@well-typed.com>2019-04-07 15:21:59 -0400
commit3a38ea4487173f0f8e3693a75d1c5c7d33f12f05 (patch)
tree45cacfc3e1071d5b34820bc9562d7b024251fc56 /testsuite/tests/warnings
parent33b0a291898b6a35d822fde59864c5c94a53d039 (diff)
downloadhaskell-3a38ea4487173f0f8e3693a75d1c5c7d33f12f05.tar.gz
Fix #16282.
Previously, -W(all-)missed-specs was created with 'NoReason', so no information about the flag was printed along with the warning. Now, -Wall-missed-specs is listed as the Reason if it was set, otherwise -Wmissed-specs is listed as the reason.
Diffstat (limited to 'testsuite/tests/warnings')
-rw-r--r--testsuite/tests/warnings/should_compile/T16282/T16282.hs14
-rw-r--r--testsuite/tests/warnings/should_compile/T16282/T16282.stderr5
-rw-r--r--testsuite/tests/warnings/should_compile/T16282/all.T1
3 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/warnings/should_compile/T16282/T16282.hs b/testsuite/tests/warnings/should_compile/T16282/T16282.hs
new file mode 100644
index 0000000000..0f6ab866a0
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T16282/T16282.hs
@@ -0,0 +1,14 @@
+import Data.Map
+
+-- If someone improves the specializer so that
+-- GHC no longer misses the specialization below,
+-- then this test will fail, as it expects a warning
+-- to be issued.
+-- Another reason this could fail is due to spelling:
+-- the test checks for the "specialisation" spelling,
+-- but due to changes in how the warnings are listed in DynFalgs.hs
+-- the compiler may spit out the "specialization" spelling.
+main :: IO ()
+main = do
+ let m = [] :: [Map String Bool]
+ mapM_ print m
diff --git a/testsuite/tests/warnings/should_compile/T16282/T16282.stderr b/testsuite/tests/warnings/should_compile/T16282/T16282.stderr
new file mode 100644
index 0000000000..3af33f12a2
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T16282/T16282.stderr
@@ -0,0 +1,5 @@
+
+T16282.hs: warning: [-Wall-missed-specialisations]
+ Could not specialise imported function ‘Data.Map.Internal.$w$cshowsPrec’
+ when specialising ‘Data.Map.Internal.$fShowMap_$cshowsPrec’
+ Probable fix: add INLINABLE pragma on ‘Data.Map.Internal.$w$cshowsPrec’
diff --git a/testsuite/tests/warnings/should_compile/T16282/all.T b/testsuite/tests/warnings/should_compile/T16282/all.T
new file mode 100644
index 0000000000..dfcdd0562a
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T16282/all.T
@@ -0,0 +1 @@
+test('T16282', normal, compile, ['-O2 -Wall-missed-specialisations']) \ No newline at end of file