For PR761:
[oota-llvm.git] / test / Transforms / LevelRaise / 2002-03-21-MissedRaise.ll
1 ; This example should be raised to return a Hash directly without casting. 
2 ; LevelRaise should eliminate all cast instructions from this testcase.
3 ;
4 ; XFAIL: *
5 ; RUN: llvm-upgrade < %s &&
6 ; RUN: llvm-upgrade < %s | llvm-as > /dev/null &&
7 ; RUN: llvm-upgrade < %s | llvm-as | opt -raise | llvm-dis | notcast
8
9         %Hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int } *
10         %hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int }
11         %hash_el = type { uint, sbyte *, \2 } *
12 implementation
13
14 %Hash "MakeHash"(int %size, int (uint) * %map)
15 begin
16         %reg112 = malloc sbyte, uint 24         ; <sbyte *> [#uses=5]
17         %reg115 = malloc sbyte, uint 96         ; <sbyte *> [#uses=1]
18         %cast237 = bitcast sbyte * %reg112 to sbyte * *         ; <sbyte * *> [#uses=1]
19         store sbyte * %reg115, sbyte * * %cast237
20
21         %cast246 = bitcast sbyte * %reg112 to %Hash             ; <%Hash> [#uses=1]
22         ret %Hash %cast246
23 end
24