mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-27 22:15:18 +00:00
add single return tests
llvm-svn: 98625
This commit is contained in:
parent
f073ba6af8
commit
7948b2bf2a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user