[mlir] Add tests for Support struct types in abi.encode/abi.decode lowering#89
Merged
vladimirradosavljevic merged 2 commits intomainfrom Mar 23, 2026
Merged
Conversation
…rrays and structs Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
…wering Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
There was a problem hiding this comment.
Pull request overview
This PR expands the MLIR/EVM test suite to cover struct handling in abi.encode / abi.decode, and adds additional storage layout regression coverage around packed fixed arrays followed by scalar members.
Changes:
- Add new lit + semantic tests for struct
abi.decodelowering, including nested structs and dynamic members. - Add new semantic tests for struct
abi.encodeacross memory/calldata and selected storage cases. - Extend existing storage struct/array tests to exercise packed fixed-array edge cases (packed array field followed by scalar field, plus a following scalar to detect layout overlap).
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/lit/mlirCodegen/storage-struct.sol | Extends MLIR “init” checks with a packed fixed-array-in-struct + tail scalar case, including guard/pad variables to detect layout overlap. |
| test/lit/mlirCodegen/EVM/storage-struct.sol | Extends EVM lowering checks for the same packed fixed-array + tail scalar storage layout scenario. |
| test/lit/mlirCodegen/EVM/storage-array.sol | Adds a scalar written from staticArr8[1] to validate packed fixed-array element access and subsequent scalar storage write in EVM lowering. |
| test/lit/mlirCodegen/EVM/abi-decode-struct.sol | New lit test file validating EVM lowering for struct ABI decode (memory + calldata, nested + dynamic members). |
| test/libsolidity/semanticTests/mlir/storage-struct.sol | Adds a semantic regression test for a packed fixed-array struct member followed by a scalar member in storage. |
| test/libsolidity/semanticTests/mlir/invalid-abi.sol | Extends invalid ABI semantic coverage to include invalid struct calldata/memory decoding/encoding paths. |
| test/libsolidity/semanticTests/mlir/abi-encode-struct.sol | New semantic test for abi.encode of structs in memory/calldata plus selected storage struct encoding cases. |
| test/libsolidity/semanticTests/mlir/abi-decode-struct.sol | New semantic test for struct ABI decode in memory/calldata, including nested/dynamic members. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
solx-llvm PR.