New testcase distilled from SPEC MCF benchmark
[oota-llvm.git] / test / Transforms / LevelRaise / 2002-03-21-MissedRaise.ll
1 ; This example should be raised to return a Hash directly without casting.  To
2 ; successful, all cast instructions should be eliminated from this testcase.
3 ;
4
5 ; RUN: if as < %s | opt -raise | dis | grep cast 
6 ; RUN: then exit 1
7 ; RUN: else exit 0
8 ; RUN: fi
9
10         %Hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int } *
11         %hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int }
12         %hash_el = type { uint, sbyte *, \2 } *
13 implementation
14
15 %Hash "MakeHash"(int %size, int (uint) * %map)
16 begin
17         %reg112 = malloc sbyte, uint 24         ; <sbyte *> [#uses=5]
18         %reg115 = malloc sbyte, uint 96         ; <sbyte *> [#uses=1]
19         %cast237 = cast sbyte * %reg112 to sbyte * *            ; <sbyte * *> [#uses=1]
20         store sbyte * %reg115, sbyte * * %cast237
21
22         %cast246 = cast sbyte * %reg112 to %Hash                ; <%Hash> [#uses=1]
23         ret %Hash %cast246
24 end
25