summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2021-03-24 18:53:17 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-11 16:58:38 -0400
commit099183437c9a181c93502026216ab8eea81db520 (patch)
treea549288752bf609ce44d38588bdfb83affbb6171 /testsuite/tests/simplCore
parent32367cac4e586fb5aedaa021b257388392d976c4 (diff)
downloadhaskell-099183437c9a181c93502026216ab8eea81db520.tar.gz
Don't warn about ClassOp bindings not specialising.
Fixes #19586
Diffstat (limited to 'testsuite/tests/simplCore')
-rw-r--r--testsuite/tests/simplCore/should_compile/T19586.hs14
-rw-r--r--testsuite/tests/simplCore/should_compile/all.T3
2 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T19586.hs b/testsuite/tests/simplCore/should_compile/T19586.hs
new file mode 100644
index 0000000000..7cce9f368d
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T19586.hs
@@ -0,0 +1,14 @@
+-- Don't warn about specialization failures for class ops.
+
+{-# OPTIONS_GHC -O -Wall-missed-specialisations #-}
+module T19586 where
+
+type MyConstraint a b = (Show a, Enum b, Show b)
+
+foo :: MyConstraint a b => Int -> a -> b -> (String, String)
+foo 0 x y = (show x, show . succ $ y)
+foo n x y = foo (n-1) x y
+
+
+bar :: Int -> Char -> (String, String)
+bar x y = foo x x y
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index dba67fa80b..935c10d6fc 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -352,6 +352,9 @@ test('T19360', only_ways(['optasm']), compile, [''])
# If the test goes wrong we'll get more case expressions in the output
test('T19581', [ grep_errmsg(r'case') ], compile, ['-O -ddump-simpl -dsuppress-uniques'])
+# T19586 should not generate missed specialisation warnings
+test('T19586', normal, compile, [''])
+
test('T19599', normal, compile, ['-O -ddump-rules'])
test('T19599a', normal, compile, ['-O -ddump-rules'])
test('T13873', [ grep_errmsg(r'SPEC') ], compile, ['-O -ddump-rules'])