forked from OSchip/llvm-project
parent
49c45d3a13
commit
8386105f3f
|
@ -238,6 +238,15 @@ static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG) {
|
|||
if (DAG.getMachineFunction().liveout_empty())
|
||||
DAG.getMachineFunction().addLiveOut(ARM::R0);
|
||||
break;
|
||||
case 5:
|
||||
Copy = DAG.getCopyToReg(Chain, ARM::R1, Op.getOperand(3), SDOperand());
|
||||
Copy = DAG.getCopyToReg(Copy, ARM::R0, Op.getOperand(1), Copy.getValue(1));
|
||||
// If we haven't noted the R0+R1 are live out, do so now.
|
||||
if (DAG.getMachineFunction().liveout_empty()) {
|
||||
DAG.getMachineFunction().addLiveOut(ARM::R0);
|
||||
DAG.getMachineFunction().addLiveOut(ARM::R1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//We must use RET_FLAG instead of BRIND because BRIND doesn't have a flag
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
; RUN: llvm-as < %s | llc -march=arm &&
|
||||
; RUN: llvm-as < %s | llc -march=arm | grep "mov r1, #0" | wc -l | grep 4 &&
|
||||
; RUN: llvm-as < %s | llc -march=arm | grep "mov r0, #1" | wc -l | grep 1 &&
|
||||
; RUN: llvm-as < %s | llc -march=arm | grep "mov r0, #2147483647" | wc -l | grep 1 &&
|
||||
; RUN: llvm-as < %s | llc -march=arm | grep "mov r0, #-2147483648" | wc -l | grep 1 &&
|
||||
; RUN: llvm-as < %s | llc -march=arm | grep "mov r0, #-1" | wc -l | grep 1 &&
|
||||
; RUN: llvm-as < %s | llc -march=arm | grep "mov r1, #2147483647" | wc -l | grep 1
|
||||
|
||||
long %f1() {
|
||||
entry:
|
||||
ret long 0
|
||||
}
|
||||
|
||||
long %f2() {
|
||||
entry:
|
||||
ret long 1
|
||||
}
|
||||
|
||||
long %f3() {
|
||||
entry:
|
||||
ret long 2147483647
|
||||
}
|
||||
|
||||
long %f4() {
|
||||
entry:
|
||||
ret long 2147483648
|
||||
}
|
||||
|
||||
long %f5() {
|
||||
entry:
|
||||
ret long 9223372036854775807
|
||||
}
|
Loading…
Reference in New Issue