1; RUN: llc < %s -mtriple=i386-pc-linux-gnu
2; PR6027
3
4%class.OlsonTimeZone = type { i16, i32*, i8*, i16 }
5
6define void @XX(%class.OlsonTimeZone* %this) align 2 {
7entry:
8  %call = tail call i8* @_Z15uprv_malloc_4_2v()
9  %0 = bitcast i8* %call to double*
10  %tmp = getelementptr inbounds %class.OlsonTimeZone* %this, i32 0, i32 3
11  %tmp2 = load i16* %tmp
12  %tmp525 = getelementptr inbounds %class.OlsonTimeZone* %this, i32 0, i32 0
13  %tmp626 = load i16* %tmp525
14  %cmp27 = icmp slt i16 %tmp2, %tmp626
15  br i1 %cmp27, label %bb.nph, label %for.end
16
17for.cond:
18  %tmp6 = load i16* %tmp5
19  %cmp = icmp slt i16 %inc, %tmp6
20  %indvar.next = add i32 %indvar, 1
21  br i1 %cmp, label %for.body, label %for.end
22
23bb.nph:
24  %tmp10 = getelementptr inbounds %class.OlsonTimeZone* %this, i32 0, i32 2
25  %tmp17 = getelementptr inbounds %class.OlsonTimeZone* %this, i32 0, i32 1
26  %tmp5 = getelementptr inbounds %class.OlsonTimeZone* %this, i32 0, i32 0
27  %tmp29 = sext i16 %tmp2 to i32
28  %tmp31 = add i16 %tmp2, 1
29  %tmp32 = zext i16 %tmp31 to i32
30  br label %for.body
31
32for.body:
33  %indvar = phi i32 [ 0, %bb.nph ], [ %indvar.next, %for.cond ]
34  %tmp30 = add i32 %indvar, %tmp29
35  %tmp33 = add i32 %indvar, %tmp32
36  %inc = trunc i32 %tmp33 to i16
37  %tmp11 = load i8** %tmp10
38  %arrayidx = getelementptr i8* %tmp11, i32 %tmp30
39  %tmp12 = load i8* %arrayidx
40  br label %for.cond
41
42for.end:
43  ret void
44}
45
46declare i8* @_Z15uprv_malloc_4_2v()
47