| 1 | const std = @import("std"); |
| 2 | const expectEqual = std.testing.expectEqual; |
| 3 | |
| 4 | test "allowzero" { |
| 5 | var zero: usize = 0; // var to make to runtime-known |
| 6 | _ = &zero; // suppress 'var is never mutated' error |
| 7 | const ptr: *allowzero i32 = @ptrFromInt(zero); |
| 8 | try expectEqual(0, @intFromPtr(ptr)); |
| 9 | } |
| 10 | |
| 11 | // test |