mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 15:42:49 +00:00
b258fdb532
closes #227
18 lines
312 B
Zig
18 lines
312 B
Zig
const assert = @import("std").debug.assert;
|
|
|
|
fn intToPtrCast() {
|
|
@setFnTest(this);
|
|
|
|
const x = isize(13);
|
|
const y = (&u8)(x);
|
|
const z = usize(y);
|
|
assert(z == 13);
|
|
}
|
|
|
|
fn numLitIntToPtrCast() {
|
|
@setFnTest(this);
|
|
|
|
const vga_mem = (&u16)(0xB8000);
|
|
assert(usize(vga_mem) == 0xB8000);
|
|
}
|