1; RUN: llc < %s 2 3; This testcase used to crash. See PR29132. 4 5target triple = "x86_64-unknown-linux-gnu" 6 7@a = common local_unnamed_addr global i16 0, align 2 8@c = common global i32 0, align 4 9@d = common local_unnamed_addr global i8 0, align 1 10@b = common global i32 0, align 4 11 12; Function Attrs: norecurse nounwind optsize uwtable 13define i32 @main() local_unnamed_addr #0 { 14entry: 15 %0 = load volatile i32, i32* @c, align 4 16 %tobool = icmp eq i32 %0, 0 17 %1 = load i16, i16* @a, align 2 18 br i1 %tobool, label %lor.rhs, label %lor.end 19 20lor.rhs: ; preds = %entry 21 %inc = add i16 %1, 1 22 store i16 %inc, i16* @a, align 2 23 br label %lor.end 24 25lor.end: ; preds = %entry, %lor.rhs 26 %2 = phi i16 [ %inc, %lor.rhs ], [ %1, %entry ] 27 %dec = add i16 %2, -1 28 store i16 %dec, i16* @a, align 2 29 %3 = load i8, i8* @d, align 1 30 %sub = sub i8 0, %3 31 %tobool4 = icmp eq i16 %dec, 0 32 br i1 %tobool4, label %land.end, label %land.rhs 33 34land.rhs: ; preds = %lor.end 35 %4 = load volatile i32, i32* @b, align 4 36 %tobool5 = icmp ne i32 %4, 0 37 br label %land.end 38 39land.end: ; preds = %lor.end, %land.rhs 40 %5 = phi i1 [ false, %lor.end ], [ %tobool5, %land.rhs ] 41 %land.ext = zext i1 %5 to i8 42 %or = or i8 %land.ext, %sub 43 store i8 %or, i8* @d, align 1 44 ret i32 0 45} 46 47attributes #0 = { norecurse nounwind optsize uwtable "target-cpu"="x86-64" } 48