blob: 17e65d8f81d9e714305b8ad532d98693fd10bded [file] [log] [blame]
Bill Wendling827f7782010-03-16 01:54:20 +00001; RUN: llc < %s -O3 -regalloc=local -mtriple=x86_64-apple-darwin10
2; <rdar://problem/7755473>
3
4%0 = type { i32, i8*, i8*, %1*, i8*, i64, i64, i32, i32, i32, i32, [1024 x i8] }
5%1 = type { i8*, i32, i32, i16, i16, %2, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %2, %3*, i32, [3 x i8], [1 x i8], %2, i32, i64 }
6%2 = type { i8*, i32 }
7%3 = type opaque
8
9declare fastcc i32 @func(%0*, i32, i32) nounwind ssp
10
11define fastcc void @func2(%0* %arg, i32 %arg1) nounwind ssp {
12bb:
13 br label %.exit3
14
15.exit3: ; preds = %.exit3, %bb
16 switch i32 undef, label %.exit3 [
17 i32 -1, label %.loopexit
18 i32 37, label %bb2
19 ]
20
21bb2: ; preds = %bb5, %bb3, %.exit3
22 br i1 undef, label %bb3, label %bb5
23
24bb3: ; preds = %bb2
25 switch i32 undef, label %infloop [
26 i32 125, label %.loopexit
27 i32 -1, label %bb4
28 i32 37, label %bb2
29 ]
30
31bb4: ; preds = %bb3
32 %tmp = add nsw i32 undef, 1 ; <i32> [#uses=1]
33 br label %.loopexit
34
35bb5: ; preds = %bb2
36 switch i32 undef, label %infloop1 [
37 i32 -1, label %.loopexit
38 i32 37, label %bb2
39 ]
40
41.loopexit: ; preds = %bb5, %bb4, %bb3, %.exit3
42 %.04 = phi i32 [ %tmp, %bb4 ], [ undef, %bb3 ], [ undef, %.exit3 ], [ undef, %bb5 ] ; <i32> [#uses=2]
43 br i1 undef, label %bb8, label %bb6
44
45bb6: ; preds = %.loopexit
46 %tmp7 = tail call fastcc i32 @func(%0* %arg, i32 %.04, i32 undef) nounwind ssp ; <i32> [#uses=0]
47 ret void
48
49bb8: ; preds = %.loopexit
50 %tmp9 = sext i32 %.04 to i64 ; <i64> [#uses=1]
51 %tmp10 = getelementptr inbounds %0* %arg, i64 0, i32 11, i64 %tmp9 ; <i8*> [#uses=1]
52 store i8 0, i8* %tmp10, align 1
53 ret void
54
55infloop: ; preds = %infloop, %bb3
56 br label %infloop
57
58infloop1: ; preds = %infloop1, %bb5
59 br label %infloop1
60}