()
| 1914 | } |
| 1915 | |
| 1916 | // --- Struct layout and heap (merged from struct_array_exec.rs) --- |
| 1917 | |
| 1918 | /// Two-field struct: fields land at the correct offsets. |
| 1919 | #[test] |
| 1920 | fn struct_two_field_access() { |
| 1921 | let (_, outcome, _) = run_hll( |
| 1922 | r#" |
| 1923 | struct Point { x: i32, y: i32 } |
| 1924 | |
| 1925 | make_point: (a: i32, b: i32) -> Point { |
| 1926 | return { .x = a, .y = b } |
| 1927 | } |
| 1928 | |
| 1929 | main: () -> i32 { |
| 1930 | p: Point = make_point(3, 7) |
| 1931 | if p.x == 3 { |
| 1932 | if p.y == 7 { |
| 1933 | return 0 |
| 1934 | } |
| 1935 | } |
| 1936 | return 1 |
| 1937 | } |