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

Function regalloc_nine_variable_args_pass_on_stack

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

Source from the content-addressed store, hash-verified

172
173#[test]
174fn regalloc_nine_variable_args_pass_on_stack() {
175 // Live variables, not constants, so the stack-passed slot loads run around
176 // the sp adjustment. They once read stale offsets after sp had moved.
177 let src = r#"
178sum_nine: (a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64, h: i64, ninth: i64) -> i64 {
179 return a + b + c + d + e + f + g + h + ninth
180}
181
182main: () -> i32 {
183 x: i64 = 10
184 y: i64 = 20
185 z: i64 = 12
186 r: i64 = sum_nine(x, y, z, x, y, z, x, y, z)
187 return (r % 256) as i32
188}
189"#;
190 let (outcome, _, _, _) = run_with_regalloc(src, false);
191 assert!(
192 matches!(outcome, StepOutcome::Halted(126)),
193 "expected Halted(126) = 3*(10+20+12), got {outcome:?}"
194 );
195 assert_equivalent(src);
196}
197
198#[test]
199fn regalloc_pointers_structs_and_arrays() {
200 assert_equivalent(

Callers

nothing calls this directly

Calls 2

run_with_regallocFunction · 0.85
assert_equivalentFunction · 0.85

Tested by

no test coverage detected