llgo/ssa: SizeOf, MakeSlice, VoidPtr

This commit is contained in:
xushiwei
2024-05-03 23:10:02 +08:00
parent 223c24450e
commit f1bb42f554
20 changed files with 595 additions and 467 deletions

20
cl/_testrt/_intgen/in.go Normal file
View File

@@ -0,0 +1,20 @@
package main
import (
"github.com/goplus/llgo/internal/runtime/c"
)
func genInts(n int, gen func() c.Int) []c.Int {
a := make([]c.Int, n)
for i := range a {
a[i] = gen()
}
return a
}
func main() {
a := genInts(5, c.Rand)
for _, v := range a {
c.Printf(c.Str("%d\n"), v)
}
}