| 1834 | "i16 store 1000 -> load should read 1000, got {outcome:?}" |
| 1835 | ); |
| 1836 | } |
| 1837 | |
| 1838 | /// Store and load an i32: value 1234567 round-trips correctly. |
| 1839 | #[test] |
| 1840 | fn mem_i32_store_load() { |
| 1841 | let (_, outcome, _) = run_hll( |
| 1842 | r#" |
| 1843 | external free: (p: i32*) -> void |
| 1844 | |
| 1845 | main: () -> i32 { |
| 1846 | p: i32* = new(i32) |
| 1847 | @p = 1234567 |
| 1848 | v: i32 = @p |
| 1849 | free(p) |
| 1850 | if v == 1234567 { |
| 1851 | return 0 |
| 1852 | } |
| 1853 | return 1 |
| 1854 | } |
| 1855 | "#, |
| 1856 | ); |
| 1857 | assert!( |
| 1858 | matches!(outcome, RunOutcome::Halted(0)), |
| 1859 | "i32 store 1234567 -> load should read 1234567, got {outcome:?}" |
| 1860 | ); |
| 1861 | } |