1; RUN: opt -O2 -disable-output < %s 2; PR15714 3 4%struct.ham = type { i32 } 5 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 14 15define void @zot12() { 16bb: 17 store i32 0, i32* @global5, align 4 18 store i32 0, i32* @global6, align 4 19 br label %bb2 20 21bb1: ; preds = %bb11 22 %tmp = load i32, i32* @global5, align 4 23 br label %bb2 24 25bb2: ; 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 31 32bb6: ; preds = %bb2 33 %tmp7 = tail call i32 @quux13() 34 br label %bb8 35 36bb8: ; preds = %bb6, %bb2 37 %tmp9 = load i32, i32* @global7, align 4 38 %tmp10 = icmp eq i32 %tmp9, 0 39 br i1 %tmp10, label %bb11, label %bb15 40 41bb11: ; preds = %bb8 42 %tmp12 = load i32, 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 47 48bb15: ; preds = %bb11, %bb8 49 ret void 50} 51 52define i32 @quux13() { 53bb: 54 store i32 1, i32* @global5, align 4 55 ret i32 1 56} 57 58define void @wombat() { 59bb: 60 tail call void @zot12() 61 ret void 62} 63 64define void @wombat14() { 65bb: 66 tail call void @blam() 67 ret void 68} 69 70define void @blam() { 71bb: 72 store i32 ptrtoint (i32* @global to i32), i32* getelementptr inbounds (%struct.ham, %struct.ham* @global8, i64 0, i32 0), align 4 73 store i32 0, i32* @global9, align 4 74 %tmp = load i32, i32* getelementptr inbounds (%struct.ham, %struct.ham* @global8, i64 0, i32 0), align 4 75 br label %bb1 76 77bb1: ; 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 90 91bb13: ; preds = %bb1 92 store i32 %tmp10, i32* getelementptr inbounds (%struct.ham, %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 96 ret void 97} 98