1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -iv-users -S -disable-output 2*9880d681SAndroid Build Coastguard Worker; 3*9880d681SAndroid Build Coastguard Worker; PR12868: Infinite recursion: 4*9880d681SAndroid Build Coastguard Worker; getUDivExpr()->getZeroExtendExpr()->isLoopBackedgeGuardedBy() 5*9880d681SAndroid Build Coastguard Worker; 6*9880d681SAndroid Build Coastguard Worker; We actually want SCEV simplification to fail gracefully in this 7*9880d681SAndroid Build Coastguard Worker; case, so there's no output to check, just the absence of stack overflow. 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Worker@c = common global i8 0, align 1 10*9880d681SAndroid Build Coastguard Worker 11*9880d681SAndroid Build Coastguard Workerdefine i32 @func() { 12*9880d681SAndroid Build Coastguard Workerentry: 13*9880d681SAndroid Build Coastguard Worker br label %for.cond 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Workerfor.cond: ; preds = %for.body, %entry 16*9880d681SAndroid Build Coastguard Worker %storemerge = phi i8 [ -1, %entry ], [ %inc, %for.body ] 17*9880d681SAndroid Build Coastguard Worker %ui.0 = phi i32 [ undef, %entry ], [ %div, %for.body ] 18*9880d681SAndroid Build Coastguard Worker %tobool = icmp eq i8 %storemerge, 0 19*9880d681SAndroid Build Coastguard Worker br i1 %tobool, label %for.end, label %for.body 20*9880d681SAndroid Build Coastguard Worker 21*9880d681SAndroid Build Coastguard Workerfor.body: ; preds = %for.cond 22*9880d681SAndroid Build Coastguard Worker %conv = sext i8 %storemerge to i32 23*9880d681SAndroid Build Coastguard Worker %div = lshr i32 %conv, 1 24*9880d681SAndroid Build Coastguard Worker %tobool2 = icmp eq i32 %div, 0 25*9880d681SAndroid Build Coastguard Worker %inc = add i8 %storemerge, 1 26*9880d681SAndroid Build Coastguard Worker br i1 %tobool2, label %for.cond, label %for.end 27*9880d681SAndroid Build Coastguard Worker 28*9880d681SAndroid Build Coastguard Workerfor.end: ; preds = %for.body, %for.cond 29*9880d681SAndroid Build Coastguard Worker ret i32 0 30*9880d681SAndroid Build Coastguard Worker} 31