- "Function return type does not match operand "
- "type of return inst!", &RI, F->getReturnType());
+ "Function return type does not match operand "
+ "type of return inst!", &RI, F->getReturnType());
+ } else if (const ArrayType *ATy = dyn_cast<ArrayType>(F->getReturnType())) {
+ // The return type is an array; check for multiple return values.
+ Assert2(ATy->getNumElements() == N,
+ "Incorrect number of return values in ret instruction!",
+ &RI, F->getReturnType());
+ for (unsigned i = 0; i != N; ++i)
+ Assert2(ATy->getElementType() == RI.getOperand(i)->getType(),
+ "Function return type does not match operand "
+ "type of return inst!", &RI, F->getReturnType());
+ } else {
+ CheckFailed("Function return type does not match operand "
+ "type of return inst!", &RI, F->getReturnType());