| 1387 | return x + y |
| 1388 | } |
| 1389 | main: () -> i32 { |
| 1390 | preserved: i32 = 100 |
| 1391 | inner_result: i32 = compute(3, 4) |
| 1392 | if preserved == 100 { |
| 1393 | if inner_result == 7 { |
| 1394 | return 0 |
| 1395 | } |
| 1396 | } |
| 1397 | return 1 |
| 1398 | } |
| 1399 | "#, |
| 1400 | ); |
| 1401 | assert!( |
| 1402 | matches!(outcome, RunOutcome::Halted(0)), |
| 1403 | "value alive across call must be preserved; inner result must be 7, got {outcome:?}" |
| 1404 | ); |
| 1405 | } |
| 1406 | |
| 1407 | /// Two-field struct returned inline (a0/a1 small-struct ABI). |
| 1408 | #[test] |
| 1409 | fn call_struct_return_two_fields() { |
| 1410 | let (_, outcome, _) = run_hll( |
| 1411 | r#" |