MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / regalloc_narrow_width_wrapping

Function regalloc_narrow_width_wrapping

tests/integration/regalloc.rs:266–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

264#[test]
265fn regalloc_narrow_width_wrapping() {
266 // Narrow integer results are width-normalized in registers exactly like a
267 // slot store/reload would truncate and sign-extend.
268 assert_equivalent(
269 r#"
270main: () -> i32 {
271 a: i8 = 100
272 b: i8 = 100
273 c: i8 = a + b
274 w: i16 = 30000
275 x: i16 = w + w
276 y: i32 = 70000
277 z: i32 = y * y
278 return ((c as i64) + (x as i64) + (z % 1000) as i64) as i32
279}
280"#,
281 );
282}
283
284#[test]
285fn regalloc_heap_alloc_and_uart_output() {
286 // malloc results cross a call boundary into allocated registers; printing

Callers

nothing calls this directly

Calls 1

assert_equivalentFunction · 0.85

Tested by

no test coverage detected