[Mlir-commits] [mlir] 17664a2 - [mlir][NFC] Fix leak in unit test

Vladislav Vinogradov llvmlistbot at llvm.org
Fri Oct 29 05:23:41 PDT 2021


Author: Vladislav Vinogradov
Date: 2021-10-29T15:24:46+03:00
New Revision: 17664a256f5f928578ef13d947f2bacf3adda021

URL: https://github.com/llvm/llvm-project/commit/17664a256f5f928578ef13d947f2bacf3adda021
DIFF: https://github.com/llvm/llvm-project/commit/17664a256f5f928578ef13d947f2bacf3adda021.diff

LOG: [mlir][NFC] Fix leak in unit test

Destroy operation created in
`OperationFormatPrintTest.CanUseVariadicFormat` test.

Added: 
    

Modified: 
    mlir/unittests/IR/OperationSupportTest.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/unittests/IR/OperationSupportTest.cpp b/mlir/unittests/IR/OperationSupportTest.cpp
index 6939064314db3..8c46d961f0cca 100644
--- a/mlir/unittests/IR/OperationSupportTest.cpp
+++ b/mlir/unittests/IR/OperationSupportTest.cpp
@@ -223,6 +223,8 @@ TEST(OperationFormatPrintTest, CanUseVariadicFormat) {
 
   std::string str = formatv("{0}", *op).str();
   ASSERT_STREQ(str.c_str(), "\"foo.bar\"() : () -> ()");
+
+  op->destroy();
 }
 
 TEST(NamedAttrListTest, TestAppendAssign) {


        


More information about the Mlir-commits mailing list