Commit 95837c0f authored by Tobias Dammers's avatar Tobias Dammers 🦈 Committed by Marge Bot

Add test cases for #16615

parent ca71d551
module T16615
where
f :: Int -> Bool
f i = if i == 0 then True else g (pred i)
g :: Int -> Bool
g i = if i == 0 then False else f (pred i)
==================== Desugar (after optimization) ====================
Result size of Desugar (after optimization)
= {terms: 36, types: 13, coercions: 0, joins: 0/0}
-- RHS size: {terms: 5, types: 0, coercions: 0, joins: 0/0}
T16615.$trModule :: GHC.Types.Module
[LclIdX]
T16615.$trModule
= GHC.Types.Module
(GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "T16615"#)
Rec {
-- RHS size: {terms: 14, types: 4, coercions: 0, joins: 0/0}
g :: Int -> Bool
[LclIdX]
g = \ (i_a26O :: Int) ->
case == @ Int GHC.Classes.$fEqInt i_a26O (GHC.Types.I# 0#) of {
False -> f (pred @ Int GHC.Enum.$fEnumInt i_a26O);
True -> GHC.Types.False
}
-- RHS size: {terms: 14, types: 4, coercions: 0, joins: 0/0}
f [Occ=LoopBreaker] :: Int -> Bool
[LclIdX]
f = \ (i_aWp :: Int) ->
case == @ Int GHC.Classes.$fEqInt i_aWp (GHC.Types.I# 0#) of {
False -> g (pred @ Int GHC.Enum.$fEnumInt i_aWp);
True -> GHC.Types.True
}
end Rec }
......@@ -107,3 +107,4 @@ test('T14773a', normal, compile, ['-Wincomplete-patterns'])
test('T14773b', normal, compile, ['-Wincomplete-patterns'])
test('T14815', [], makefile_test, ['T14815'])
test('T13208', [], makefile_test, ['T13208'])
test('T16615', normal, compile, ['-ddump-ds'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment