()
| 2079 | } |
| 2080 | return 1 |
| 2081 | } |
| 2082 | "#, |
| 2083 | ); |
| 2084 | assert!( |
| 2085 | matches!(outcome, StepOutcome::Halted(0)), |
| 2086 | "mixed struct: small=7 big=0x8010_0000, got {outcome:?}" |
| 2087 | ); |
| 2088 | } |
| 2089 | |
| 2090 | // --- IR instruction lowering (merged from ir_instruction_exec.rs) --- |
| 2091 | // HLL programs cover ops the language expresses directly; directly-constructed |
| 2092 | // IR covers ops with no HLL surface syntax (signed shift, etc.). |
| 2093 | |
| 2094 | /// Signed integer division with a negative dividend must use `div` (signed). |
| 2095 | #[test] |
| 2096 | fn ir_math_signed_div() { |
| 2097 | let (_, outcome, _) = run_hll( |
| 2098 | r#" |
| 2099 | main: () -> i32 { |
| 2100 | result: i32 = -8 / 2 |
| 2101 | if result == -4 { |
| 2102 | return 0 |
| 2103 | } |
| 2104 | return 1 |
| 2105 | } |
| 2106 | "#, |
| 2107 | ); |
| 2108 | assert!( |
| 2109 | matches!(outcome, StepOutcome::Halted(0)), |
| 2110 | "signed -8 / 2 should equal -4, got {outcome:?}" |
| 2111 | ); |
nothing calls this directly
no test coverage detected