Fix memory leaks in mlir/test/CAPI/ir.c

This commit is contained in:
Mehdi Amini 2021-10-02 04:45:40 +00:00
parent a1d1c31746
commit 237d18a61a
1 changed files with 5 additions and 0 deletions

View File

@ -1525,6 +1525,7 @@ int registerOnlyStd() {
ctx, mlirStringRefCreateFromCString(
"not_existing_dialect.not_existing_op")));
mlirContextDestroy(ctx);
return 0;
}
@ -1666,6 +1667,9 @@ int testClone() {
// CHECK: constant 0 : index
// CHECK: constant 1 : index
mlirOperationDestroy(constZero);
mlirOperationDestroy(constOne);
mlirContextDestroy(ctx);
return 0;
}
@ -1737,6 +1741,7 @@ void testDiagnostics() {
// CHECK: deleting user data (userData: 42)
// CHECK-NOT: processing diagnostic
// CHECK: more test diagnostics
mlirContextDestroy(ctx);
}
int testTypeID(MlirContext ctx) {