From: NAKAMURA Takumi Date: Wed, 23 Jan 2013 08:30:26 +0000 (+0000) Subject: IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction immediately... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c8f08d305af27c279a0e4d649c651620238e1a7;p=platform%2Fupstream%2Fllvm.git IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction immediately if it is not linked. llvm-svn: 173236 --- diff --git a/llvm/unittests/IR/ConstantsTest.cpp b/llvm/unittests/IR/ConstantsTest.cpp index db783f7..5c739cd 100644 --- a/llvm/unittests/IR/ConstantsTest.cpp +++ b/llvm/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) {