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 | 86ca5493f7c58d3d9ad565f65028d2ffa51e2cde (patch) | |
tree | 9adb79b1945fd1eb769f5e208f11c22589d2e2e4 /llvm/unittests/VMCore/InstructionsTest.cpp | |
parent | 35a9b8baeb434c93a6e9c47bac68310fa6ebf1c5 (diff) | |
download | bcm5719-llvm-86ca5493f7c58d3d9ad565f65028d2ffa51e2cde.tar.gz bcm5719-llvm-86ca5493f7c58d3d9ad565f65028d2ffa51e2cde.zip |
add single return tests
llvm-svn: 98625
Diffstat (limited to 'llvm/unittests/VMCore/InstructionsTest.cpp')
-rw-r--r-- | llvm/unittests/VMCore/InstructionsTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/unittests/VMCore/InstructionsTest.cpp b/llvm/unittests/VMCore/InstructionsTest.cpp index 15f894039f1..81563484f7b 100644 --- a/llvm/unittests/VMCore/InstructionsTest.cpp +++ b/llvm/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 |