1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -indvars -S | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; PR13371: indvars pass incorrectly substitutes 'undef' values 3*9880d681SAndroid Build Coastguard Worker; 4*9880d681SAndroid Build Coastguard Worker; LFTR should not user %undef as the loop counter. 5*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @test( 6*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: icmp{{.*}}undef 7*9880d681SAndroid Build Coastguard Worker@.str3 = private constant [6 x i8] c"%lld\0A\00", align 1 8*9880d681SAndroid Build Coastguard Workerdeclare i32 @printf(i8* noalias nocapture, ...) nounwind 9*9880d681SAndroid Build Coastguard Workerdefine i64 @test() nounwind { 10*9880d681SAndroid Build Coastguard Workerfunc_start: 11*9880d681SAndroid Build Coastguard Worker br label %block9 12*9880d681SAndroid Build Coastguard Workerblock9: ; preds = %block9,%func_start 13*9880d681SAndroid Build Coastguard Worker %undef = phi i64 [ %next_undef, %block9 ], [ undef, %func_start ] 14*9880d681SAndroid Build Coastguard Worker %iter = phi i64 [ %next_iter, %block9 ], [ 1, %func_start ] 15*9880d681SAndroid Build Coastguard Worker %next_iter = add nsw i64 %iter, 1 16*9880d681SAndroid Build Coastguard Worker %0 = tail call i32 (i8*, ...) @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef) 17*9880d681SAndroid Build Coastguard Worker %next_undef = add nsw i64 %undef, 1 18*9880d681SAndroid Build Coastguard Worker %_tmp_3 = icmp slt i64 %next_iter, 100 19*9880d681SAndroid Build Coastguard Worker br i1 %_tmp_3, label %block9, label %exit 20*9880d681SAndroid Build Coastguard Workerexit: ; preds = %block9 21*9880d681SAndroid Build Coastguard Worker ret i64 0 22*9880d681SAndroid Build Coastguard Worker} 23