Correct this error message.
authorNick Lewycky <nicholas@mxc.ca>
Sat, 15 Nov 2008 17:50:47 +0000 (17:50 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sat, 15 Nov 2008 17:50:47 +0000 (17:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59370 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp
test/Verifier/2008-11-15-RetVoid.ll [new file with mode: 0644]

index 7540cc83189793c10f40087f4f6323db5caf3259..a699ab2af205292d3fc9657a5baef9d39a89eea9 100644 (file)
@@ -639,7 +639,7 @@ void Verifier::visitReturnInst(ReturnInst &RI) {
   unsigned N = RI.getNumOperands();
   if (F->getReturnType() == Type::VoidTy) 
     Assert2(N == 0,
-            "Found return instr that returns void in Function of non-void "
+            "Found return instr that returns non-void in Function of void "
             "return type!", &RI, F->getReturnType());
   else if (N == 1 && F->getReturnType() == RI.getOperand(0)->getType()) {
     // Exactly one return value and it matches the return type. Good.
diff --git a/test/Verifier/2008-11-15-RetVoid.ll b/test/Verifier/2008-11-15-RetVoid.ll
new file mode 100644 (file)
index 0000000..dbdcae2
--- /dev/null
@@ -0,0 +1,5 @@
+; RUN: not llvm-as < %s |& grep {returns non-void in Function of void return}
+
+define void @foo() {
+  ret i32 0
+}