1 ; RUN: opt -O2 -disable-output < %s
4 %struct.ham = type { i32 }
6 @global5 = common global i32 0, align 4
7 @global6 = common global i32 0, align 4
8 @global7 = common global i32 0, align 4
9 @global = common global i32 0, align 4
10 @global8 = common global %struct.ham zeroinitializer, align 4
11 @global9 = common global i32 0, align 4
12 @global10 = common global i32 0, align 4
13 @global11 = common global i32 0, align 4
15 define void @zot12() {
17 store i32 0, i32* @global5, align 4
18 store i32 0, i32* @global6, align 4
22 %tmp = load i32* @global5, align 4
25 bb2: ; preds = %bb1, %bb
26 %tmp3 = phi i32 [ %tmp, %bb1 ], [ 0, %bb ]
27 %tmp4 = xor i32 %tmp3, zext (i1 icmp ne (i64 ptrtoint (i32* @global5 to i64), i64 1) to i32)
28 store i32 %tmp4, i32* @global5, align 4
29 %tmp5 = icmp eq i32 %tmp3, zext (i1 icmp ne (i64 ptrtoint (i32* @global5 to i64), i64 1) to i32)
30 br i1 %tmp5, label %bb8, label %bb6
33 %tmp7 = tail call i32 @quux13()
36 bb8: ; preds = %bb6, %bb2
37 %tmp9 = load i32* @global7, align 4
38 %tmp10 = icmp eq i32 %tmp9, 0
39 br i1 %tmp10, label %bb11, label %bb15
42 %tmp12 = load i32* @global6, align 4
43 %tmp13 = add nsw i32 %tmp12, 1
44 store i32 %tmp13, i32* @global6, align 4
45 %tmp14 = icmp slt i32 %tmp13, 42
46 br i1 %tmp14, label %bb1, label %bb15
48 bb15: ; preds = %bb11, %bb8
52 define i32 @quux13() {
54 store i32 1, i32* @global5, align 4
58 define void @wombat() {
60 tail call void @zot12()
64 define void @wombat14() {
66 tail call void @blam()
72 store i32 ptrtoint (i32* @global to i32), i32* getelementptr inbounds (%struct.ham* @global8, i64 0, i32 0), align 4
73 store i32 0, i32* @global9, align 4
74 %tmp = load i32* getelementptr inbounds (%struct.ham* @global8, i64 0, i32 0), align 4
77 bb1: ; preds = %bb1, %bb
78 %tmp2 = phi i32 [ 0, %bb ], [ %tmp11, %bb1 ]
79 %tmp3 = phi i32 [ %tmp, %bb ], [ %tmp10, %bb1 ]
80 %tmp4 = icmp sgt i32 %tmp3, 0
81 %tmp5 = zext i1 %tmp4 to i32
82 %tmp6 = urem i32 %tmp5, 5
83 %tmp7 = mul i32 %tmp3, -80
84 %tmp8 = or i32 %tmp7, %tmp6
85 %tmp9 = icmp eq i32 %tmp8, 0
86 %tmp10 = zext i1 %tmp9 to i32
87 %tmp11 = add nsw i32 %tmp2, 1
88 %tmp12 = icmp eq i32 %tmp11, 20
89 br i1 %tmp12, label %bb13, label %bb1
92 store i32 %tmp10, i32* getelementptr inbounds (%struct.ham* @global8, i64 0, i32 0), align 4
93 store i32 0, i32* @global10, align 4
94 store i32 %tmp6, i32* @global11, align 4
95 store i32 20, i32* @global9, align 4