diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-03-16 11:24:53 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-03-16 11:24:53 +0000 |
commit | 22385eb8527f6bf8083ee85f85dc51e4d4928aaa (patch) | |
tree | 03db51a8beea0aabeced43227a42121de2550daf /unittests/VMCore | |
parent | 138acfe353ed8b895de093a4c118b01093b6fbfb (diff) | |
download | external_llvm-22385eb8527f6bf8083ee85f85dc51e4d4928aaa.zip external_llvm-22385eb8527f6bf8083ee85f85dc51e4d4928aaa.tar.gz external_llvm-22385eb8527f6bf8083ee85f85dc51e4d4928aaa.tar.bz2 |
add single return tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98625 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/VMCore')
-rw-r--r-- | unittests/VMCore/InstructionsTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/unittests/VMCore/InstructionsTest.cpp b/unittests/VMCore/InstructionsTest.cpp index 15f8940..8156348 100644 --- a/unittests/VMCore/InstructionsTest.cpp +++ b/unittests/VMCore/InstructionsTest.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Instructions.h" +#include "llvm/DerivedTypes.h" #include "llvm/LLVMContext.h" #include "gtest/gtest.h" @@ -20,6 +21,16 @@ TEST(InstructionsTest, ReturnInst) { // test for PR6589 const ReturnInst* r0 = ReturnInst::Create(C); EXPECT_EQ(r0->op_begin(), r0->op_end()); + + const IntegerType* Int1 = IntegerType::get(C, 1); + Constant* One = ConstantInt::get(Int1, 1, true); + const ReturnInst* r1 = ReturnInst::Create(C, One); + User::const_op_iterator b(r1->op_begin()); + EXPECT_NE(b, r1->op_end()); + EXPECT_EQ(*b, One); + EXPECT_EQ(r1->getOperand(0), One); + ++b; + EXPECT_EQ(b, r1->op_end()); } } // end anonymous namespace |