diff --git a/mlir/test/CAPI/pass.c b/mlir/test/CAPI/pass.c index 5e78287ca6471..0cf015e0d9138 100644 --- a/mlir/test/CAPI/pass.c +++ b/mlir/test/CAPI/pass.c @@ -189,6 +189,8 @@ void testParsePassPipeline() { mlirPrintPassPipeline(mlirPassManagerGetAsOpPassManager(pm), printToStderr, NULL); fprintf(stderr, "\n"); + mlirPassManagerDestroy(pm); + mlirContextDestroy(ctx); } int main() { diff --git a/mlir/unittests/Rewrite/PatternBenefit.cpp b/mlir/unittests/Rewrite/PatternBenefit.cpp index 86b1aa13a8cac..79552f06025be 100644 --- a/mlir/unittests/Rewrite/PatternBenefit.cpp +++ b/mlir/unittests/Rewrite/PatternBenefit.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include "mlir/IR/OwningOpRef.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Rewrite/PatternApplicator.h" #include "gtest/gtest.h" @@ -20,7 +21,7 @@ TEST(PatternBenefitTest, BenefitOrder) { MLIRContext context; OpBuilder builder(&context); - auto module = ModuleOp::create(builder.getUnknownLoc()); + OwningOpRef module = ModuleOp::create(builder.getUnknownLoc()); struct Pattern1 : public OpRewritePattern { Pattern1(mlir::MLIRContext *context, bool *called) @@ -71,7 +72,7 @@ TEST(PatternBenefitTest, BenefitOrder) { }; MyPatternRewriter rewriter(&context); - (void)pa.matchAndRewrite(module, rewriter); + (void)pa.matchAndRewrite(*module, rewriter); EXPECT_TRUE(called1); EXPECT_TRUE(called2);