2017-01-05 00:57:48 -08:00
|
|
|
const assert = @import("std").debug.assert;
|
2016-12-21 22:42:30 -08:00
|
|
|
|
2017-01-05 00:57:48 -08:00
|
|
|
fn intToPtrCast() {
|
|
|
|
@setFnTest(this);
|
|
|
|
|
|
|
|
const x = isize(13);
|
|
|
|
const y = (&u8)(x);
|
|
|
|
const z = usize(y);
|
|
|
|
assert(z == 13);
|
2016-12-21 22:42:30 -08:00
|
|
|
}
|
2017-01-31 10:38:04 -08:00
|
|
|
|
|
|
|
fn numLitIntToPtrCast() {
|
|
|
|
@setFnTest(this);
|
|
|
|
|
|
|
|
const vga_mem = (&u16)(0xB8000);
|
|
|
|
assert(usize(vga_mem) == 0xB8000);
|
|
|
|
}
|