Files
zig/test/cases/compile_errors/bad_alignCast_at_comptime.zig
2022-07-23 15:40:11 +03:00

12 lines
228 B
Zig

comptime {
const ptr = @intToPtr(*align(1) i32, 0x1);
const aligned = @alignCast(4, ptr);
_ = aligned;
}
// error
// backend=stage2
// target=native
//
// :3:35: error: pointer address 0x1 is not aligned to 4 bytes