| 1410 | let (_, outcome, _) = run_hll( |
| 1411 | r#" |
| 1412 | divide: (a: i32, b: i32) -> { quotient: i32, remainder: i32 } { |
| 1413 | return { .quotient = a / b, .remainder = a % b } |
| 1414 | } |
| 1415 | main: () -> i32 { |
| 1416 | { quotient: i32, remainder: i32 } = divide(17, 5) |
| 1417 | if quotient == 3 { |
| 1418 | if remainder == 2 { |
| 1419 | return 0 |
| 1420 | } |
| 1421 | } |
| 1422 | return 1 |
| 1423 | } |
| 1424 | "#, |
| 1425 | ); |
| 1426 | assert!( |
| 1427 | matches!(outcome, RunOutcome::Halted(0)), |
| 1428 | "17 / 5 = 3 remainder 2 (struct return), got {outcome:?}" |
| 1429 | ); |
| 1430 | } |
| 1431 | |
| 1432 | /// Return value must be usable in a subsequent expression. |
| 1433 | #[test] |