Skip to content

Extend cast lowering coverage#347

Open
uurl wants to merge 1 commit into
NVlabs:mainfrom
uurl:test/extend-mir-cast-lowering-coverage
Open

Extend cast lowering coverage#347
uurl wants to merge 1 commit into
NVlabs:mainfrom
uurl:test/extend-mir-cast-lowering-coverage

Conversation

@uurl

@uurl uurl commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Part of #303.

Summary

Adds additional focused unit coverage for existing MIR cast lowering paths.

The existing cast-lowering tests covered representative cases for integer widening/narrowing, unsigned integer-to-float, signed float-to-int saturation, and pointer address exposure. This PR extends that coverage to additional documented cast dispatch paths in cast.rs.

What changed

Adds tests for:

  • Same-width integer casts lowering to llvm.bitcast.
  • Signed integer-to-float casts lowering to llvm.sitofp.
  • Unsigned float-to-integer casts lowering through the expected llvm_fptoui_sat_* intrinsic.
  • Float widening casts lowering to llvm.fpext.
  • Float narrowing casts lowering to llvm.fptrunc.
  • Pointer-with-exposed-provenance casts lowering to llvm.inttoptr.
  • Pointer-to-pointer casts across address spaces lowering to llvm.addrspacecast, including verification of the resulting address space.

Testing

  • cargo fmt --all -- --check
  • cargo test -p mir-lower convert::ops::cast::tests --lib
  • cargo test -p mir-lower
  • cargo clippy --workspace -- -D warnings

Checklist

  • Test coverage only; no compiler behavior change
  • No crates/cuda-bindings/ changes

Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant