()
| 172 | |
| 173 | #[test] |
| 174 | fn 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#" |
| 178 | sum_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 | |
| 182 | main: () -> 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] |
| 199 | fn regalloc_pointers_structs_and_arrays() { |
| 200 | assert_equivalent( |
nothing calls this directly
no test coverage detected