zig/test/cases/alignof.zig
Andrew Kelley a35b366eb6 [breaking] delete ptr deref prefix op
start using zig-fmt-pointer-reform branch build of zig fmt
to fix code to use the new syntax

all of test/cases/* are processed, but there are more left
to be done - all the std lib used by the behavior tests
2018-04-30 20:35:54 -04:00

16 lines
340 B
Zig

const assert = @import("std").debug.assert;
const builtin = @import("builtin");
const Foo = struct {
x: u32,
y: u32,
z: u32,
};
test "@alignOf(T) before referencing T" {
comptime assert(@alignOf(Foo) != @maxValue(usize));
if (builtin.arch == builtin.Arch.x86_64) {
comptime assert(@alignOf(Foo) == 4);
}
}