[Mlir-commits] [mlir] Reorder OpBuildGen.cpp (PR #129976)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Mar 5 18:40:22 PST 2025


https://github.com/wenzhi-cui created https://github.com/llvm/llvm-project/pull/129976

verifyOp will erase the op so must be called later.

>From f3e2031591d5667619ffd16680889b35d9196526 Mon Sep 17 00:00:00 2001
From: wenzhi-cui <40185576+wenzhi-cui at users.noreply.github.com>
Date: Wed, 5 Mar 2025 18:39:55 -0800
Subject: [PATCH] Reorder OpBuildGen.cpp

verifyOp will erase the op so must be called later.
---
 mlir/unittests/TableGen/OpBuildGen.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/unittests/TableGen/OpBuildGen.cpp b/mlir/unittests/TableGen/OpBuildGen.cpp
index b4a5c316d63d6..ec1d5f63f8c24 100644
--- a/mlir/unittests/TableGen/OpBuildGen.cpp
+++ b/mlir/unittests/TableGen/OpBuildGen.cpp
@@ -303,8 +303,8 @@ TEST_F(OpBuildGenTest, BuildMethodsInherentDiscardableAttrs) {
   // place works.
   auto op7b = builder.create<test::TableGenBuildOp7>(loc, TypeRange{},
                                                      ValueRange{}, attrs);
-  verifyOp(op7b, {}, {}, attrs);
   ASSERT_EQ(op7b.getProperties().getAttr0(), attrs[0].getValue());
+  verifyOp(op7b, {}, {}, attrs);
 }
 
 } // namespace mlir



More information about the Mlir-commits mailing list