Index: include/llvm/Function.h
===================================================================
--- include/llvm/Function.h	(revision 167575)
+++ include/llvm/Function.h	(working copy)
@@ -259,6 +259,10 @@
     addFnAttr(Attributes::UWTable);
   }
 
+  bool isNaked() const {
+    return getFnAttributes().hasAttribute(Attributes::Naked);
+  }
+
   /// @brief True if this function needs an unwind table.
   bool needsUnwindTableEntry() const {
     return hasUWTable() || !doesNotThrow();
Index: lib/VMCore/Verifier.cpp
===================================================================
--- lib/VMCore/Verifier.cpp	(revision 167575)
+++ lib/VMCore/Verifier.cpp	(working copy)
@@ -832,15 +832,18 @@
 
 void Verifier::visitReturnInst(ReturnInst &RI) {
   Function *F = RI.getParent()->getParent();
-  unsigned N = RI.getNumOperands();
-  if (F->getReturnType()->isVoidTy()) 
-    Assert2(N == 0,
-            "Found return instr that returns non-void in Function of void "
-            "return type!", &RI, F->getReturnType());
-  else
-    Assert2(N == 1 && F->getReturnType() == RI.getOperand(0)->getType(),
-            "Function return type does not match operand "
-            "type of return inst!", &RI, F->getReturnType());
+  if(!F->isNaked())
+  {
+    unsigned N = RI.getNumOperands();
+    if (F->getReturnType()->isVoidTy()) 
+      Assert2(N == 0,
+              "Found return instr that returns non-void in Function of void "
+              "return type!", &RI, F->getReturnType());
+    else
+      Assert2(N == 1 && F->getReturnType() == RI.getOperand(0)->getType(),
+              "Function return type does not match operand "
+              "type of return inst!", &RI, F->getReturnType());
+  }
 
   // Check to make sure that the return value has necessary properties for
   // terminators...
