test: add tests for i32 arithmetic intrinsics#1160
Merged
Conversation
This was referenced Jun 4, 2026
a7d1db3 to
168ba09
Compare
168ba09 to
e7cf774
Compare
This was referenced Jun 8, 2026
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.
Sets up testing of intrinsics by building an executable from MASM that calls the intrinsic to be tested. This is possible now that the toolchain can handle MASM. We then assert that the return values of the intrinsic correspond to the expected result computed natively via Rust.
Motivation
i32::overflowing_mulbut the generated MASM does not call thei32::overflowing_mulintrinsic. So Native/MASM divergence for intrinsici32::overflowing_mul#1161 was discovered only after directly testingproc i32::overflowing_mulhere.Implementation details
i32.masmintrinsics becauseFeltsi32and all outputs are eitheri32or can be easily mapped toi32(e.g.boolbecomes either0i32or1i32)NumericStrategyhas been moved such that it can be used in the existing tests inarithmetic.rsand in the new tests inintrinsics/i32_arithmetic.rs.Strategyvalues andNumericStrategymethods were added.Issues discovered by these tests
#1161, #1162, #1163