| 1746 | bump() |
| 1747 | v: i32 = counter |
| 1748 | if v == 3 { |
| 1749 | return 0 |
| 1750 | } |
| 1751 | return 1 |
| 1752 | } |
| 1753 | "#, |
| 1754 | ); |
| 1755 | assert!( |
| 1756 | matches!(outcome, RunOutcome::Halted(0)), |
| 1757 | "counter bumped 3 times should equal 3, got {outcome:?}" |
| 1758 | ); |
| 1759 | } |
| 1760 | |
| 1761 | // --- Memory width load/store (merged from memory_width_exec.rs) --- |
| 1762 | |
| 1763 | /// Store and load an i8: positive value 127 round-trips without corruption. |
| 1764 | #[test] |
| 1765 | fn mem_i8_store_load_positive() { |
| 1766 | let (_, outcome, _) = run_hll( |
| 1767 | r#" |
| 1768 | external free: (p: i8*) -> void |
| 1769 | |
| 1770 | main: () -> i32 { |
| 1771 | p: i8* = new(i8) |
| 1772 | @p = 127 |