Skip to content

Commit

Permalink
[BPF] Remove exit-on-error from tests (PR27768, PR27769)
Browse files Browse the repository at this point in the history
The exit-on-error flag is necessary to avoid some assertions/unreachables. We
can get past them by creating a few dummy nodes.

Fixes PR27768, PR27769.

Differential Revision: http://reviews.llvm.org/D20726

llvm-svn: 271200
  • Loading branch information
rovka committed May 30, 2016
1 parent 3b9f4cf commit f353a5e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion llvm/lib/Target/BPF/BPFISelLowering.cpp
Expand Up @@ -346,6 +346,7 @@ BPFTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,
const SmallVectorImpl<ISD::OutputArg> &Outs,
const SmallVectorImpl<SDValue> &OutVals,
SDLoc DL, SelectionDAG &DAG) const {
unsigned Opc = BPFISD::RET_FLAG;

// CCValAssign - represent the assignment of the return value to a location
SmallVector<CCValAssign, 16> RVLocs;
Expand All @@ -356,6 +357,7 @@ BPFTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,

if (MF.getFunction()->getReturnType()->isAggregateType()) {
fail(DL, DAG, "only integer returns supported");
return DAG.getNode(Opc, DL, MVT::Other, Chain);
}

// Analize return values.
Expand All @@ -377,7 +379,6 @@ BPFTargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,
RetOps.push_back(DAG.getRegister(VA.getLocReg(), VA.getLocVT()));
}

unsigned Opc = BPFISD::RET_FLAG;
RetOps[0] = Chain; // Update chain.

// Add the flag if we have it.
Expand All @@ -399,6 +400,9 @@ SDValue BPFTargetLowering::LowerCallResult(

if (Ins.size() >= 2) {
fail(DL, DAG, "only small returns supported");
for (unsigned i = 0, e = Ins.size(); i != e; ++i)
InVals.push_back(DAG.getConstant(0, DL, Ins[i].VT));
return DAG.getCopyFromReg(Chain, DL, 1, Ins[0].VT, InFlag).getValue(1);
}

CCInfo.AnalyzeCallResult(Ins, RetCC_BPF64);
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/BPF/struct_ret1.ll
@@ -1,4 +1,4 @@
; RUN: not llc -march=bpf -exit-on-error < %s 2> %t1
; RUN: not llc -march=bpf < %s 2> %t1
; RUN: FileCheck %s < %t1
; CHECK: only integer returns

Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/BPF/struct_ret2.ll
@@ -1,4 +1,4 @@
; RUN: not llc -march=bpf -exit-on-error < %s 2> %t1
; RUN: not llc -march=bpf < %s 2> %t1
; RUN: FileCheck %s < %t1
; CHECK: only small returns

Expand Down

0 comments on commit f353a5e

Please sign in to comment.