diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2008-06-05 14:00:36 +0000 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2008-06-05 14:00:36 +0000 |
commit | 411e6a5efb438cad2a455f462e2611529ffab3f2 (patch) | |
tree | b3dc24c3bdad6d56fcf2a30ec71da8f6b85bc77e /lib/VMCore/Verifier.cpp | |
parent | b499c86331c6e11de31273b1dad91706f598f447 (diff) | |
download | external_llvm-411e6a5efb438cad2a455f462e2611529ffab3f2.zip external_llvm-411e6a5efb438cad2a455f462e2611529ffab3f2.tar.gz external_llvm-411e6a5efb438cad2a455f462e2611529ffab3f2.tar.bz2 |
Change the Verifier to support returning first class aggregrates.
Add a testcase for functions returning first class aggregrates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index bfa2e65..8cbb703 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -594,7 +594,10 @@ void Verifier::visitReturnInst(ReturnInst &RI) { Assert2(N == 0, "Found return instr that returns void in Function of non-void " "return type!", &RI, F->getReturnType()); - else if (const StructType *STy = dyn_cast<StructType>(F->getReturnType())) { + else if (N > 1) { + const StructType *STy = dyn_cast<StructType>(F->getReturnType()); + Assert2(STy, "Return instr with multiple values, but return type is not " + "a struct", &RI, F->getReturnType()); Assert2(STy->getNumElements() == N, "Incorrect number of return values in ret instruction!", &RI, F->getReturnType()); |