Commit 20363feb authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #4908

parent cec6e4d7
{-# LANGUAGE MagicHash #-}
module T4908 where
import GHC.Base
f :: Int -> (Int,Int) -> Bool
f 0 x = True
f n x = case x of (a,b) -> case b of
I# 0# -> True
I# _ -> f (n-1) x
==================== Tidy Core ====================
Rec {
T4908.f_$s$wf [Occ=LoopBreaker]
:: GHC.Types.Int
-> GHC.Prim.Int#
-> GHC.Prim.Int#
-> GHC.Types.Bool
[GblId, Arity=3, Caf=NoCafRefs, Str=DmdType LLL]
T4908.f_$s$wf =
\ (sc :: GHC.Types.Int)
(sc1 :: GHC.Prim.Int#)
(sc2 :: GHC.Prim.Int#) ->
case sc2 of ds {
__DEFAULT ->
case sc1 of ds1 {
__DEFAULT -> T4908.f_$s$wf sc ds1 (GHC.Prim.-# ds 1);
0 -> GHC.Types.True
};
0 -> GHC.Types.True
}
end Rec }
T4908.$wf
:: GHC.Prim.Int#
-> (GHC.Types.Int, GHC.Types.Int)
-> GHC.Types.Bool
[GblId,
Arity=2,
Caf=NoCafRefs,
Str=DmdType LL,
Unf=Unf{Src=<vanilla>, TopLvl=True, Arity=2, Value=True,
ConLike=True, Cheap=True, Expandable=True,
Guidance=IF_ARGS [3 2] 11 2}]
T4908.$wf =
\ (ww :: GHC.Prim.Int#) (w :: (GHC.Types.Int, GHC.Types.Int)) ->
case ww of ds {
__DEFAULT ->
case w of _ { (a, b) ->
case b of _ { GHC.Types.I# ds1 ->
case ds1 of ds2 {
__DEFAULT -> T4908.f_$s$wf a ds2 (GHC.Prim.-# ds 1);
0 -> GHC.Types.True
}
}
};
0 -> GHC.Types.True
}
T4908.f [InlPrag=INLINE[0]]
:: GHC.Types.Int
-> (GHC.Types.Int, GHC.Types.Int)
-> GHC.Types.Bool
[GblId,
Arity=2,
Caf=NoCafRefs,
Str=DmdType U(L)L,
Unf=Unf{Src=Worker=T4908.$wf, TopLvl=True, Arity=2, Value=True,
ConLike=True, Cheap=True, Expandable=True,
Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)
Tmpl= \ (w [Occ=Once!] :: GHC.Types.Int)
(w1 [Occ=Once] :: (GHC.Types.Int, GHC.Types.Int)) ->
case w of _ { GHC.Types.I# ww [Occ=Once] -> T4908.$wf ww w1 }}]
T4908.f =
\ (w :: GHC.Types.Int) (w1 :: (GHC.Types.Int, GHC.Types.Int)) ->
case w of _ { GHC.Types.I# ww -> T4908.$wf ww w1 }
------ Local rules for imported ids --------
"SC:$wf0" [ALWAYS]
forall {sc :: GHC.Types.Int
sc1 :: GHC.Prim.Int#
sc2 :: GHC.Prim.Int#}
T4908.$wf sc2 (sc, GHC.Types.I# sc1)
= T4908.f_$s$wf sc sc1 sc2
......@@ -59,6 +59,9 @@ test('T3717', only_ways(['optc','optasm']),
test('spec-inline', only_ways(['optc','optasm']),
compile,
['-O2 -ddump-simpl -dsuppress-uniques'])
test('T4908', only_ways(['optc','optasm']),
compile,
['-O2 -ddump-simpl -dsuppress-uniques'])
test('T3055',
extra_clean(['T3055.hi', 'T3055.o', 'T3055.simpl']),
......
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