about summary refs log tree commit diff
path: root/lang/zig/allowzero.zig
blob: 39233dc3c1da2a195d6307a39b7f4961b48e3974 (plain) (blame)
1
2
3
4
5
6
7
const expect = @import("std").testing.expect;

test "allowzero" {
    var zero: usize = 0;
    var ptr = @intToPtr(*allowzero i32, zero);
    expect(@ptrToInt(ptr) == 0);
}