abiType: support pointer

This commit is contained in:
xushiwei
2024-05-24 22:47:45 +08:00
parent 9b4701fed7
commit 3cc975813d
8 changed files with 201 additions and 106 deletions

View File

@@ -1,20 +1,19 @@
package main
import (
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/cl/internal/foo"
)
func main() {
bar := foo.Bar()
if x, ok := bar.(struct{ V int }); ok {
c.Printf(c.Str("%d\n"), x.V)
println(x.V)
} else {
c.Printf(c.Str("Bar: not ok\n"))
println("Bar: not ok")
}
if x, ok := foo.F().(struct{ v int }); ok {
c.Printf(c.Str("%d\n"), x.v)
println(x.v)
} else {
c.Printf(c.Str("F: not ok\n"))
println("F: not ok")
}
}