migrate langref documentation generation to the build system

This commit is contained in:
Andrew Kelley
2024-04-24 17:41:47 -07:00
parent 9d64332a59
commit 1b90888f57
283 changed files with 7745 additions and 6371 deletions

View File

@@ -0,0 +1,24 @@
const std = @import("std");
const expect = std.testing.expect;
const BitField = packed struct {
a: u3,
b: u3,
c: u2,
};
var bit_field = BitField{
.a = 1,
.b = 2,
.c = 3,
};
test "pointer to non-byte-aligned field" {
try expect(bar(&bit_field.b) == 2);
}
fn bar(x: *const u3) u3 {
return x.*;
}
// test_error=expected type