v/vlib/v/checker/tests/pointer_ops.vv

14 lines
176 B
V

// void* arithmetic is not allowed in MSVC, so ban it
fn test_voidptr() {
unsafe {
mut p := voidptr(0)
_ = p + 1
p++
p += 3
_ = p - 1
p--
p -= 3
_ = p[3]
}
}