[Mlir-commits] [mlir] [MLIR] check resource attr of module in TEST(Bytecode, MultiModuleWithResource) (PR #119618)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Dec 11 13:57:20 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Soren Lassen (sorenlassen)

<details>
<summary>Changes</summary>

`checkResourceAttribute` accidentally ignored its argument and only checked `roundTripModule` and not `module`

---
Full diff: https://github.com/llvm/llvm-project/pull/119618.diff


1 Files Affected:

- (modified) mlir/unittests/Bytecode/BytecodeTest.cpp (+2-2) 


``````````diff
diff --git a/mlir/unittests/Bytecode/BytecodeTest.cpp b/mlir/unittests/Bytecode/BytecodeTest.cpp
index baf5d5c650e309..cb915a092a0be8 100644
--- a/mlir/unittests/Bytecode/BytecodeTest.cpp
+++ b/mlir/unittests/Bytecode/BytecodeTest.cpp
@@ -69,8 +69,8 @@ TEST(Bytecode, MultiModuleWithResource) {
     GTEST_SKIP();
 
   // Try to see if we have a valid resource in the parsed module.
-  auto checkResourceAttribute = [&](Operation *op) {
-    Attribute attr = roundTripModule->getDiscardableAttr("bytecode.test");
+  auto checkResourceAttribute = [](Operation *parsedModule) {
+    Attribute attr = parsedModule->getDiscardableAttr("bytecode.test");
     ASSERT_TRUE(attr);
     auto denseResourceAttr = dyn_cast<DenseI32ResourceElementsAttr>(attr);
     ASSERT_TRUE(denseResourceAttr);

``````````

</details>


https://github.com/llvm/llvm-project/pull/119618


More information about the Mlir-commits mailing list