mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 23:52:31 +00:00
2b395d4ede
closes #1466 closes #1476
18 lines
386 B
Zig
18 lines
386 B
Zig
const std = @import("std");
|
|
const assert = std.debug.assert;
|
|
const builtin = @import("builtin");
|
|
const maxInt = std.math.maxInt;
|
|
|
|
const Foo = struct.{
|
|
x: u32,
|
|
y: u32,
|
|
z: u32,
|
|
};
|
|
|
|
test "@alignOf(T) before referencing T" {
|
|
comptime assert(@alignOf(Foo) != maxInt(usize));
|
|
if (builtin.arch == builtin.Arch.x86_64) {
|
|
comptime assert(@alignOf(Foo) == 4);
|
|
}
|
|
}
|