diff options
-rw-r--r-- | llvm/lib/Target/Sparc/SparcISelLowering.cpp | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/SPARC/missing-sret.ll | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/llvm/lib/Target/Sparc/SparcISelLowering.cpp index 73730990125..d07d48669cc 100644 --- a/llvm/lib/Target/Sparc/SparcISelLowering.cpp +++ b/llvm/lib/Target/Sparc/SparcISelLowering.cpp @@ -1040,8 +1040,8 @@ SparcTargetLowering::getSRetArgSize(SelectionDAG &DAG, SDValue Callee) const if (!CalleeFn) return 0; - assert(CalleeFn->hasStructRetAttr() && - "Callee does not have the StructRet attribute."); + // It would be nice to check for the sret attribute on CalleeFn here, + // but since it is not part of the function type, any check will misfire. PointerType *Ty = cast<PointerType>(CalleeFn->arg_begin()->getType()); Type *ElementTy = Ty->getElementType(); diff --git a/llvm/test/CodeGen/SPARC/missing-sret.ll b/llvm/test/CodeGen/SPARC/missing-sret.ll new file mode 100644 index 00000000000..683d840bd25 --- /dev/null +++ b/llvm/test/CodeGen/SPARC/missing-sret.ll @@ -0,0 +1,9 @@ +; RUN: llc -march=sparc -filetype=obj < %s > /dev/null 2> %t2 + +define void @mul_double_cc({ double, double }* noalias sret %agg.result, double %a, double %b, double %c, double %d) { +entry: + call void @__muldc3({ double, double }* sret %agg.result, double %a, double %b, double %c, double %d) + ret void +} + +declare void @__muldc3({ double, double }*, double, double, double, double) |