From 70c44f0cce6516df270019444f8f04066d6b16c9 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sat, 15 Nov 2008 17:50:47 +0000 Subject: [PATCH] Correct this error message. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59370 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Verifier.cpp | 2 +- test/Verifier/2008-11-15-RetVoid.ll | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 test/Verifier/2008-11-15-RetVoid.ll diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 7540cc83189..a699ab2af20 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -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 index 00000000000..dbdcae28515 --- /dev/null +++ b/test/Verifier/2008-11-15-RetVoid.ll @@ -0,0 +1,5 @@ +; RUN: not llvm-as < %s |& grep {returns non-void in Function of void return} + +define void @foo() { + ret i32 0 +} -- 2.34.1