-#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); \