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, ptr @global5, align 4
18 store i32 0, ptr @global6, align 4
22 %tmp = load i32, ptr @global5, align 4
25 bb2: ; preds = %bb1, %bb
26 %tmp3 = phi i32 [ %tmp, %bb1 ], [ 0, %bb ]
27 %cmp = icmp ne i64 ptrtoint (ptr @global5 to i64), 1
28 %ext = zext i1 %cmp to i32
29 %tmp4 = xor i32 %tmp3, %ext
30 store i32 %tmp4, ptr @global5, align 4
31 %tmp5 = icmp eq i32 %tmp3, %ext
32 br i1 %tmp5, label %bb8, label %bb6
35 %tmp7 = tail call i32 @quux13()
38 bb8: ; preds = %bb6, %bb2
39 %tmp9 = load i32, ptr @global7, align 4
40 %tmp10 = icmp eq i32 %tmp9, 0
41 br i1 %tmp10, label %bb11, label %bb15
44 %tmp12 = load i32, ptr @global6, align 4
45 %tmp13 = add nsw i32 %tmp12, 1
46 store i32 %tmp13, ptr @global6, align 4
47 %tmp14 = icmp slt i32 %tmp13, 42
48 br i1 %tmp14, label %bb1, label %bb15
50 bb15: ; preds = %bb11, %bb8
54 define i32 @quux13() {
56 store i32 1, ptr @global5, align 4
60 define void @wombat() {
62 tail call void @zot12()
66 define void @wombat14() {
68 tail call void @blam()
74 store i32 ptrtoint (ptr @global to i32), ptr @global8, align 4
75 store i32 0, ptr @global9, align 4
76 %tmp = load i32, ptr @global8, align 4
79 bb1: ; preds = %bb1, %bb
80 %tmp2 = phi i32 [ 0, %bb ], [ %tmp11, %bb1 ]
81 %tmp3 = phi i32 [ %tmp, %bb ], [ %tmp10, %bb1 ]
82 %tmp4 = icmp sgt i32 %tmp3, 0
83 %tmp5 = zext i1 %tmp4 to i32
84 %tmp6 = urem i32 %tmp5, 5
85 %tmp7 = mul i32 %tmp3, -80
86 %tmp8 = or i32 %tmp7, %tmp6
87 %tmp9 = icmp eq i32 %tmp8, 0
88 %tmp10 = zext i1 %tmp9 to i32
89 %tmp11 = add nsw i32 %tmp2, 1
90 %tmp12 = icmp eq i32 %tmp11, 20
91 br i1 %tmp12, label %bb13, label %bb1
94 store i32 %tmp10, ptr @global8, align 4
95 store i32 0, ptr @global10, align 4
96 store i32 %tmp6, ptr @global11, align 4
97 store i32 20, ptr @global9, align 4