()
| 1957 | sum: i32 = quotient + remainder |
| 1958 | if sum == 5 { |
| 1959 | return 0 |
| 1960 | } |
| 1961 | return 1 |
| 1962 | } |
| 1963 | "#, |
| 1964 | ); |
| 1965 | assert!( |
| 1966 | matches!(outcome, RunOutcome::Halted(0)), |
| 1967 | "23 / 7 = 3 remainder 2; quotient + remainder = 5, got {outcome:?}" |
| 1968 | ); |
| 1969 | } |
| 1970 | |
| 1971 | /// Struct returned from one call fed into another. |
| 1972 | #[test] |
| 1973 | fn struct_return_chained() { |
| 1974 | let (_, outcome, _) = run_hll( |
| 1975 | r#" |
| 1976 | minmax: (a: i32, b: i32) -> { lo: i32, hi: i32 } { |
| 1977 | if a < b { |
| 1978 | return { .lo = a, .hi = b } |
| 1979 | } |