IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction immediately if it is not linked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173236 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi
2013-01-23 08:30:26 +00:00
parent bde0f0f225
commit 6bf3e46aa8

View File

@@ -151,12 +151,14 @@ TEST(ConstantsTest, PointerCast) {
Constant::getNullValue(Int8PtrVecTy), Int32PtrVecTy)); Constant::getNullValue(Int8PtrVecTy), Int32PtrVecTy));
} }
#define CHECK(x, y) { \ #define CHECK(x, y) { \
std::string __s; \ std::string __s; \
raw_string_ostream __o(__s); \ raw_string_ostream __o(__s); \
cast<ConstantExpr>(x)->getAsInstruction()->print(__o); \ Instruction *__I = cast<ConstantExpr>(x)->getAsInstruction(); \
__o.flush(); \ __I->print(__o); \
EXPECT_EQ(std::string(" <badref> = " y), __s); \ delete __I; \
__o.flush(); \
EXPECT_EQ(std::string(" <badref> = " y), __s); \
} }
TEST(ConstantsTest, AsInstructionsTest) { TEST(ConstantsTest, AsInstructionsTest) {