diff options
Diffstat (limited to 'testsuite/tests/simplCore/should_compile')
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T19586.hs | 14 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/all.T | 3 |
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']) |