ssa: builtin copy

This commit is contained in:
visualfc
2024-05-19 19:33:41 +08:00
parent af4a0ffa21
commit cda572fd59
6 changed files with 98 additions and 0 deletions

View File

@@ -26,4 +26,9 @@ func main() {
println(data)
var i any = 100
println(true, 100, -100, uint(255), int32(-100), 100.5, i, &i, uintptr(unsafe.Pointer(&i)))
var dst [3]byte
n := copy(dst[:], data)
println(n, dst[0], dst[1], dst[2])
n = copy(dst[1:], "ABCD")
println(n, dst[0], dst[1], dst[2])
}