Skip to content

Commit 9b8fbbf

Browse files
committed
add more assertions about struct alignment to tests
1 parent b831fd1 commit 9b8fbbf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/stage1/behavior/align.zig

+2-1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ test "read 128-bit field from default aligned struct in stack memory" {
269269
.nevermind = 1,
270270
.badguy = 12,
271271
};
272+
expect((@ptrToInt(&default_aligned.badguy) % 16) == 0);
272273
expect(12 == default_aligned.badguy);
273274
}
274275

@@ -278,7 +279,7 @@ var default_aligned_global = DefaultAligned {
278279
};
279280

280281
test "read 128-bit field from default aligned struct in global memory" {
281-
282+
expect((@ptrToInt(&default_aligned_global.badguy) % 16) == 0);
282283
expect(12 == default_aligned_global.badguy);
283284
}
284285

0 commit comments

Comments
 (0)