diff options
| author | Diana Picus <diana.picus@linaro.org> | 2016-05-30 08:28:34 +0000 |
|---|---|---|
| committer | Diana Picus <diana.picus@linaro.org> | 2016-05-30 08:28:34 +0000 |
| commit | f353a5e06d961cac8e5f9ae86572396d7a1ffac6 (patch) | |
| tree | ea883573ef3ab71cf29b569df0b16f9f91c80671 | |
| parent | 3b9f4cf4626991d96bac4146897a6af8418417c0 (diff) | |
| download | bcm5719-llvm-f353a5e06d961cac8e5f9ae86572396d7a1ffac6.tar.gz bcm5719-llvm-f353a5e06d961cac8e5f9ae86572396d7a1ffac6.zip | |
[BPF] Remove exit-on-error from tests (PR27768, PR27769)
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
| -rw-r--r-- | llvm/lib/Target/BPF/BPFISelLowering.cpp | 6 | ||||
| -rw-r--r-- | llvm/test/CodeGen/BPF/struct_ret1.ll | 2 | ||||
| -rw-r--r-- | llvm/test/CodeGen/BPF/struct_ret2.ll | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Target/BPF/BPFISelLowering.cpp b/llvm/lib/Target/BPF/BPFISelLowering.cpp index ca2370b5b5f..409f484ba6e 100644 --- a/llvm/lib/Target/BPF/BPFISelLowering.cpp +++ b/llvm/lib/Target/BPF/BPFISelLowering.cpp @@ -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; @@ -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. @@ -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. @@ -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); diff --git a/llvm/test/CodeGen/BPF/struct_ret1.ll b/llvm/test/CodeGen/BPF/struct_ret1.ll index c6d3f89b9a9..29486b56a27 100644 --- a/llvm/test/CodeGen/BPF/struct_ret1.ll +++ b/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 diff --git a/llvm/test/CodeGen/BPF/struct_ret2.ll b/llvm/test/CodeGen/BPF/struct_ret2.ll index 5266efed776..90461205f7c 100644 --- a/llvm/test/CodeGen/BPF/struct_ret2.ll +++ b/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 |

