Files
llgo/cl/_testcgo/alloca/in.go

15 lines
206 B
Go
Raw Normal View History

2024-04-29 17:58:10 +08:00
package main
import (
"unsafe"
"github.com/goplus/llgo/internal/runtime/c"
)
func main() {
s := c.String("Hi\n")
s2 := c.Alloca(4)
c.Memcpy(s2, unsafe.Pointer(s), 4)
2024-04-29 20:51:27 +08:00
c.Printf(c.String("%s"), s2)
2024-04-29 17:58:10 +08:00
}