aboutsummaryrefslogtreecommitdiff
path: root/unittests/IR/ConstantsTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/IR/ConstantsTest.cpp')
-rw-r--r--unittests/IR/ConstantsTest.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/unittests/IR/ConstantsTest.cpp b/unittests/IR/ConstantsTest.cpp
index db783f72d4..5c739cd217 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<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) {