Commit 0491ff94 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #4930

parent 20363feb
module T4930 where
foo :: Int -> Int
foo n = (if n < 5 then error "Too small" else n+2)
`seq` n+5
==================== Tidy Core ====================
lvl :: [GHC.Types.Char]
[GblId]
lvl = GHC.Base.unpackCString# "Too small"
T4930.foo1 :: GHC.Types.Int
[GblId, Str=DmdType b]
T4930.foo1 = GHC.Err.error @ GHC.Types.Int lvl
T4930.foo :: GHC.Types.Int -> GHC.Types.Int
[GblId,
Arity=1,
Str=DmdType U(L)m,
Unf=Unf{Src=InlineStable, TopLvl=True, Arity=1, Value=True,
ConLike=True, Cheap=True, Expandable=True,
Guidance=ALWAYS_IF(unsat_ok=True,boring_ok=False)
Tmpl= \ (n [Occ=Once!] :: GHC.Types.Int) ->
case n of _ { GHC.Types.I# x ->
case GHC.Prim.<# x 5 of _ {
GHC.Types.False -> GHC.Types.I# (GHC.Prim.+# x 5);
GHC.Types.True -> T4930.foo1
}
}}]
T4930.foo =
\ (n :: GHC.Types.Int) ->
case n of _ { GHC.Types.I# x ->
case GHC.Prim.<# x 5 of _ {
GHC.Types.False -> GHC.Types.I# (GHC.Prim.+# x 5);
GHC.Types.True -> T4930.foo1
}
}
......@@ -63,6 +63,10 @@ test('T4908', only_ways(['optc','optasm']),
compile,
['-O2 -ddump-simpl -dsuppress-uniques'])
test('T4930', only_ways(['optc','optasm']),
compile,
['-O -ddump-simpl -dsuppress-uniques'])
test('T3055',
extra_clean(['T3055.hi', 'T3055.o', 'T3055.simpl']),
run_command,
......
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