| 1 | const expectEqual = @import("std").testing.expectEqual; |
| 2 | |
| 3 | test "@intFromPtr and @ptrFromInt" { |
| 4 | const ptr: *i32 = @ptrFromInt(0xdeadbee0); |
| 5 | const addr = @intFromPtr(ptr); |
| 6 | try expectEqual(usize, @TypeOf(addr)); |
| 7 | try expectEqual(0xdeadbee0, addr); |
| 8 | } |
| 9 | |
| 10 | // test |