| 1342 | } |
| 1343 | main: () -> i32 { |
| 1344 | result: i32 = sum_eight(1, 2, 3, 4, 5, 6, 7, 8) |
| 1345 | if result == 36 { |
| 1346 | return 0 |
| 1347 | } |
| 1348 | return 1 |
| 1349 | } |
| 1350 | "#, |
| 1351 | ); |
| 1352 | assert!( |
| 1353 | matches!(outcome, RunOutcome::Halted(0)), |
| 1354 | "sum of 1..8 = 36, got {outcome:?}" |
| 1355 | ); |
| 1356 | } |
| 1357 | |
| 1358 | /// The ninth argument must be passed via the caller's stack frame. |
| 1359 | #[test] |
| 1360 | fn call_ninth_arg() { |
| 1361 | let (_, outcome, _) = run_hll( |
| 1362 | r#" |
| 1363 | sum_nine: (a: i32, b: i32, c: i32, d: i32, e: i32, f: i32, g: i32, h: i32, ninth: i32) -> i32 { |
| 1364 | return a + b + c + d + e + f + g + h + ninth |
| 1365 | } |
| 1366 | main: () -> i32 { |