[llvm-commits] [llvm] r173236 - /llvm/trunk/unittests/IR/ConstantsTest.cpp
NAKAMURA Takumi
geek4civic at gmail.com
Wed Jan 23 00:30:27 PST 2013
Author: chapuni
Date: Wed Jan 23 02:30:26 2013
New Revision: 173236
URL: http://llvm.org/viewvc/llvm-project?rev=173236&view=rev
Log:
IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction immediately if it is not linked.
Modified:
llvm/trunk/unittests/IR/ConstantsTest.cpp
Modified: llvm/trunk/unittests/IR/ConstantsTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/ConstantsTest.cpp?rev=173236&r1=173235&r2=173236&view=diff
==============================================================================
--- llvm/trunk/unittests/IR/ConstantsTest.cpp (original)
+++ llvm/trunk/unittests/IR/ConstantsTest.cpp Wed Jan 23 02:30:26 2013
@@ -151,12 +151,14 @@
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) {
More information about the llvm-commits
mailing list