From 6bf3e46aa87d0cb6044f2282a40411211bf95a5d Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Wed, 23 Jan 2013 08:30:26 +0000 Subject: 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 --- unittests/IR/ConstantsTest.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/unittests/IR/ConstantsTest.cpp b/unittests/IR/ConstantsTest.cpp index db783f7..5c739cd 100644 --- a/unittests/IR/ConstantsTest.cpp +++ b/unittests/IR/ConstantsTest.cpp @@ -151,12 +151,14 @@ TEST(ConstantsTest, PointerCast) { Constant::getNullValue(Int8PtrVecTy), Int32PtrVecTy)); } -#define CHECK(x, y) { \ - std::string __s; \ - raw_string_ostream __o(__s); \ - cast(x)->getAsInstruction()->print(__o); \ - __o.flush(); \ - EXPECT_EQ(std::string(" = " y), __s); \ +#define CHECK(x, y) { \ + std::string __s; \ + raw_string_ostream __o(__s); \ + Instruction *__I = cast(x)->getAsInstruction(); \ + __I->print(__o); \ + delete __I; \ + __o.flush(); \ + EXPECT_EQ(std::string(" = " y), __s); \ } TEST(ConstantsTest, AsInstructionsTest) { -- cgit v1.1