| ... | ... | @@ -2,7 +2,7 @@ const std = @import("std"); |
| 2 | 2 | const expect = std.testing.expect; |
| 3 | 3 | const expectEqualSlices = std.testing.expectEqualSlices; |
| 4 | 4 | const builtin = @import("builtin"); |
| 5 | | const maxInt = std.math.maxInt; |
| 5 | const maxInt = std.math.maxInt; |
| 6 | 6 | const StructWithNoFields = struct { |
| 7 | 7 | fn add(a: i32, b: i32) i32 { |
| 8 | 8 | return a + b; |
| ... | ... | @@ -256,7 +256,11 @@ const Foo96Bits = packed struct { |
| 256 | 256 | test "packed struct 24bits" { |
| 257 | 257 | comptime { |
| 258 | 258 | expect(@sizeOf(Foo24Bits) == 4); |
| 259 | | expect(@sizeOf(Foo96Bits) == 16); |
| 259 | if (@sizeOf(usize) == 4) { |
| 260 | expect(@sizeOf(Foo96Bits) == 12); |
| 261 | } else { |
| 262 | expect(@sizeOf(Foo96Bits) == 16); |
| 263 | } |
| 260 | 264 | } |
| 261 | 265 | |
| 262 | 266 | var value = Foo96Bits{ |
| ... | ... | @@ -505,10 +509,10 @@ test "packed struct with u0 field access" { |
| 505 | 509 | comptime expect(s.f0 == 0); |
| 506 | 510 | } |
| 507 | 511 | |
| 508 | | const S0 = struct{ |
| 512 | const S0 = struct { |
| 509 | 513 | bar: S1, |
| 510 | 514 | |
| 511 | | pub const S1 = struct{ |
| 515 | pub const S1 = struct { |
| 512 | 516 | value: u8, |
| 513 | 517 | }; |
| 514 | 518 | |