Skip to content

Commit

Permalink
IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instructio…
Browse files Browse the repository at this point in the history
…n immediately if it is not linked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173236 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chapuni committed Jan 23, 2013
1 parent bde0f0f commit 6bf3e46
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions unittests/IR/ConstantsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,14 @@ TEST(ConstantsTest, PointerCast) {
Constant::getNullValue(Int8PtrVecTy), Int32PtrVecTy));
}

#define CHECK(x, y) { \
std::string __s; \
raw_string_ostream __o(__s); \
cast<ConstantExpr>(x)->getAsInstruction()->print(__o); \
__o.flush(); \
EXPECT_EQ(std::string(" <badref> = " y), __s); \
#define CHECK(x, y) { \
std::string __s; \
raw_string_ostream __o(__s); \
Instruction *__I = cast<ConstantExpr>(x)->getAsInstruction(); \
__I->print(__o); \
delete __I; \
__o.flush(); \
EXPECT_EQ(std::string(" <badref> = " y), __s); \
}

TEST(ConstantsTest, AsInstructionsTest) {
Expand Down

0 comments on commit 6bf3e46

Please sign in to comment.