1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -O2 -march=x86 -mtriple=i386-pc-linux-gnu -relocation-model=pic | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; PR9237: Assertion in VirtRegRewriter.cpp, ResurrectConfirmedKill 3*9880d681SAndroid Build Coastguard Worker; `KillOps[*SR] == KillOp && "invalid subreg kill flags"' 4*9880d681SAndroid Build Coastguard Worker 5*9880d681SAndroid Build Coastguard Worker%t = type { i32 } 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard Workerdefine i32 @foo(%t* %s) nounwind { 8*9880d681SAndroid Build Coastguard Workerentry: 9*9880d681SAndroid Build Coastguard Worker br label %if.then735 10*9880d681SAndroid Build Coastguard Worker 11*9880d681SAndroid Build Coastguard Workerif.then735: 12*9880d681SAndroid Build Coastguard Worker %call747 = call i32 undef(%t* %s, i8* null, i8* undef, i32 128, i8* undef, i32 516) nounwind 13*9880d681SAndroid Build Coastguard Worker br i1 undef, label %if.then751, label %if.then758 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Workerif.then751: 16*9880d681SAndroid Build Coastguard Worker unreachable 17*9880d681SAndroid Build Coastguard Worker 18*9880d681SAndroid Build Coastguard Workerif.then758: 19*9880d681SAndroid Build Coastguard Worker %add761 = add i32 %call747, 4 20*9880d681SAndroid Build Coastguard Worker %add763 = add i32 %add761, %call747 21*9880d681SAndroid Build Coastguard Worker %add.ptr768 = getelementptr inbounds [516 x i8], [516 x i8]* null, i32 0, i32 %add761 22*9880d681SAndroid Build Coastguard Worker br i1 undef, label %cond.false783, label %cond.true771 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Workercond.true771: 25*9880d681SAndroid Build Coastguard Worker %call782 = call i8* @__memmove_chk(i8* %add.ptr768, i8* undef, i32 %call747, i32 undef) 26*9880d681SAndroid Build Coastguard Worker br label %cond.end791 27*9880d681SAndroid Build Coastguard Worker 28*9880d681SAndroid Build Coastguard Worker; CHECK: calll __memmove_chk 29*9880d681SAndroid Build Coastguard Workercond.false783: 30*9880d681SAndroid Build Coastguard Worker %call.i1035 = call i8* @__memmove_chk(i8* %add.ptr768, i8* undef, i32 %call747, i32 undef) nounwind 31*9880d681SAndroid Build Coastguard Worker br label %cond.end791 32*9880d681SAndroid Build Coastguard Worker 33*9880d681SAndroid Build Coastguard Workercond.end791: 34*9880d681SAndroid Build Coastguard Worker %conv801 = trunc i32 %call747 to i8 35*9880d681SAndroid Build Coastguard Worker %add.ptr822.sum = add i32 %call747, 3 36*9880d681SAndroid Build Coastguard Worker %arrayidx833 = getelementptr inbounds [516 x i8], [516 x i8]* null, i32 0, i32 %add.ptr822.sum 37*9880d681SAndroid Build Coastguard Worker store i8 %conv801, i8* %arrayidx833, align 1 38*9880d681SAndroid Build Coastguard Worker %cmp841 = icmp eq i8* undef, null 39*9880d681SAndroid Build Coastguard Worker br i1 %cmp841, label %if.end849, label %if.then843 40*9880d681SAndroid Build Coastguard Worker 41*9880d681SAndroid Build Coastguard Workerif.then843: 42*9880d681SAndroid Build Coastguard Worker unreachable 43*9880d681SAndroid Build Coastguard Worker 44*9880d681SAndroid Build Coastguard Workerif.end849: 45*9880d681SAndroid Build Coastguard Worker %call921 = call i32 undef(%t* %s, i8* undef, i8* undef, i32 %add763) nounwind 46*9880d681SAndroid Build Coastguard Worker unreachable 47*9880d681SAndroid Build Coastguard Worker 48*9880d681SAndroid Build Coastguard Worker} 49*9880d681SAndroid Build Coastguard Worker 50*9880d681SAndroid Build Coastguard Workerdeclare i8* @__memmove_chk(i8*, i8*, i32, i32) nounwind 51