Merge branch 'master' into atomics
[ghc.git] / testsuite / tests / simplCore / should_compile / T5776.hs
1 module T5776 where
2
3 -- The point about this test is that we should get a rule like this:
4 -- "foo" [ALWAYS]
5 -- forall (@ a)
6 -- ($dEq :: GHC.Classes.Eq a)
7 -- ($dEq1 :: GHC.Classes.Eq a)
8 -- (x :: a)
9 -- (y :: a)
10 -- (z :: a).
11 -- T5776.f (GHC.Classes.== @ a $dEq1 x y)
12 -- (GHC.Classes.== @ a $dEq y z)
13 -- = GHC.Types.True
14 --
15 -- Note the *two* forall'd dEq parameters. This is important.
16 -- See Note [Simplifying RULE lhs constraints] in TcSimplify
17
18 {-# RULES "foo" forall x y z.
19 f (x == y) (y == z) = True
20 #-}
21
22 f :: Bool -> Bool -> Bool
23 {-# NOINLINE f #-}
24 f a b = False
25
26 blah :: Int -> Int -> Bool
27 blah x y = f (x==y) (x==y)
28