| 637 | assert_eq!( |
| 638 | format!("{base_outcome:?}"), |
| 639 | format!("{opt_outcome:?}"), |
| 640 | "IR optimization changed the exit outcome on the control-flow program" |
| 641 | ); |
| 642 | assert_eq!(base_uart, opt_uart, "IR optimization changed UART output"); |
| 643 | } |
| 644 | |
| 645 | #[test] |
| 646 | fn hll_new_i32_and_return() { |
| 647 | let (_, outcome, _) = run_hll( |
| 648 | r#" |
| 649 | main: () -> i32 { |
| 650 | p: i32* = new(i32) |
| 651 | @p = 42 |
| 652 | return @p |
| 653 | } |
| 654 | "#, |
| 655 | ); |
| 656 | assert!( |
| 657 | matches!(outcome, StepOutcome::Halted(42)), |
| 658 | "expected Halted(42), got {outcome:?}" |
| 659 | ); |
| 660 | } |
| 661 | |
| 662 | // --- HLL full-pipeline VM tests --- |
| 663 | |