31 lines · plain
1; RUN: opt < %s -passes='require<iv-users>' -S -disable-output2;3; PR12868: Infinite recursion:4; getUDivExpr()->getZeroExtendExpr()->isLoopBackedgeGuardedBy()5;6; We actually want SCEV simplification to fail gracefully in this7; case, so there's no output to check, just the absence of stack overflow.8 9@c = common global i8 0, align 110 11define i32 @func() {12entry:13 br label %for.cond14 15for.cond: ; preds = %for.body, %entry16 %storemerge = phi i8 [ -1, %entry ], [ %inc, %for.body ]17 %ui.0 = phi i32 [ undef, %entry ], [ %div, %for.body ]18 %tobool = icmp eq i8 %storemerge, 019 br i1 %tobool, label %for.end, label %for.body20 21for.body: ; preds = %for.cond22 %conv = sext i8 %storemerge to i3223 %div = lshr i32 %conv, 124 %tobool2 = icmp eq i32 %div, 025 %inc = add i8 %storemerge, 126 br i1 %tobool2, label %for.cond, label %for.end27 28for.end: ; preds = %for.body, %for.cond29 ret i32 030}31