()
| 2048 | return 0 |
| 2049 | } |
| 2050 | return 1 |
| 2051 | } |
| 2052 | "#, |
| 2053 | ); |
| 2054 | assert!( |
| 2055 | matches!(outcome, StepOutcome::Halted(0)), |
| 2056 | "middle field b=99 must be readable at offset 4, got {outcome:?}" |
| 2057 | ); |
| 2058 | } |
| 2059 | |
| 2060 | /// Struct with mixed i32 and i64 fields: i64 must be aligned to 8 bytes. |
| 2061 | #[test] |
| 2062 | fn struct_mixed_i32_i64_fields() { |
| 2063 | let (_, outcome, _) = run_hll( |
| 2064 | r#" |
| 2065 | struct Mixed { small: i32, big: i64 } |
| 2066 | |
| 2067 | make_mixed: (s: i32, b: i64) -> Mixed { |
| 2068 | return { .small = s, .big = b } |
| 2069 | } |
| 2070 | |
| 2071 | main: () -> i32 { |
| 2072 | m: Mixed = make_mixed(7, 2148532224) |
| 2073 | a: i64 = 1048576 |
| 2074 | expected: i64 = a * 2049 |
| 2075 | if m.small == 7 { |
| 2076 | if m.big == expected { |
| 2077 | return 0 |
| 2078 | } |
| 2079 | } |
| 2080 | return 1 |
nothing calls this directly
no test coverage detected