migrate langref documentation generation to the build system
This commit is contained in:
16
doc/langref/test_aligned_struct_fields.zig
Normal file
16
doc/langref/test_aligned_struct_fields.zig
Normal file
@@ -0,0 +1,16 @@
|
||||
const std = @import("std");
|
||||
const expectEqual = std.testing.expectEqual;
|
||||
|
||||
test "aligned struct fields" {
|
||||
const S = struct {
|
||||
a: u32 align(2),
|
||||
b: u32 align(64),
|
||||
};
|
||||
var foo = S{ .a = 1, .b = 2 };
|
||||
|
||||
try expectEqual(64, @alignOf(S));
|
||||
try expectEqual(*align(2) u32, @TypeOf(&foo.a));
|
||||
try expectEqual(*align(64) u32, @TypeOf(&foo.b));
|
||||
}
|
||||
|
||||
// test
|
||||
Reference in New Issue
Block a user