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

Function regalloc_mixed_float_and_int

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

Source from the content-addressed store, hash-verified

237#[test]
238fn regalloc_mixed_float_and_int() {
239 // Floats stay slot-based while their integer neighbors are allocated; the
240 // GP/FP boundary (casts, compares) must agree between modes.
241 assert_equivalent(
242 r#"
243main: () -> i32 {
244 acc: f64 = 0.0
245 half: f64 = 0.5
246 lo: f64 = 2474.0
247 hi: f64 = 2476.0
248 i: i64 = 0
249 while i < 100 {
250 acc = acc + (i as f64) * half
251 i = i + 1
252 }
253 if acc > lo {
254 if acc < hi {
255 return 42
256 }
257 }
258 return 1
259}
260"#,
261 );
262}
263
264#[test]
265fn regalloc_narrow_width_wrapping() {
266 // Narrow integer results are width-normalized in registers exactly like a

Callers

nothing calls this directly

Calls 1

assert_equivalentFunction · 0.85

Tested by

no test coverage detected