2017-06-15 20:47:05 -07:00
|
|
|
const assert = @import("std").debug.assert;
|
|
|
|
const builtin = @import("builtin");
|
|
|
|
|
|
|
|
const Foo = struct { x: u32, y: u32, z: u32, };
|
|
|
|
|
2017-08-29 04:30:22 -07:00
|
|
|
test "@alignOf(T) before referencing T" {
|
|
|
|
comptime assert(@alignOf(Foo) != @maxValue(usize));
|
2017-06-15 20:47:05 -07:00
|
|
|
if (builtin.arch == builtin.Arch.x86_64) {
|
2017-08-29 04:30:22 -07:00
|
|
|
comptime assert(@alignOf(Foo) == 4);
|
2017-06-15 20:47:05 -07:00
|
|
|
}
|
|
|
|
}
|