aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/LevelRaise/2002-03-21-MissedRaise.ll
blob: 440f9ea5ff76af239265a8f1656b275cafca9c55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
; This example should be raised to return a Hash directly without casting. 
; LevelRaise should eliminate all cast instructions from this testcase.
;
; XFAIL: *
; RUN: llvm-upgrade < %s | llvm-as | opt -raise | llvm-dis | notcast

	%Hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int } *
	%hash = type { { uint, sbyte *, \2 } * *, int (uint) *, int }
	%hash_el = type { uint, sbyte *, \2 } *
implementation

%Hash "MakeHash"(int %size, int (uint) * %map)
begin
	%reg112 = malloc sbyte, uint 24		; <sbyte *> [#uses=5]
	%reg115 = malloc sbyte, uint 96		; <sbyte *> [#uses=1]
	%cast237 = cast sbyte * %reg112 to sbyte * *		; <sbyte * *> [#uses=1]
	store sbyte * %reg115, sbyte * * %cast237

	%cast246 = cast sbyte * %reg112 to %Hash		; <%Hash> [#uses=1]
	ret %Hash %cast246
end