Index: llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp =================================================================== --- llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp +++ llvm/trunk/lib/Target/BPF/BPFISelLowering.cpp @@ -346,6 +346,7 @@ const SmallVectorImpl &Outs, const SmallVectorImpl &OutVals, SDLoc DL, SelectionDAG &DAG) const { + unsigned Opc = BPFISD::RET_FLAG; // CCValAssign - represent the assignment of the return value to a location SmallVector RVLocs; @@ -356,6 +357,7 @@ 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 @@ 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 @@ 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); Index: llvm/trunk/test/CodeGen/BPF/struct_ret1.ll =================================================================== --- llvm/trunk/test/CodeGen/BPF/struct_ret1.ll +++ llvm/trunk/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 Index: llvm/trunk/test/CodeGen/BPF/struct_ret2.ll =================================================================== --- llvm/trunk/test/CodeGen/BPF/struct_ret2.ll +++ llvm/trunk/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