cl: isVargs support defer/go

This commit is contained in:
xushiwei
2024-06-11 10:35:27 +08:00
parent 1ecd9af2e1
commit 5e5d149ca5
6 changed files with 213 additions and 8 deletions

16
cl/_testlibc/defer/in.go Normal file
View File

@@ -0,0 +1,16 @@
package main
import "github.com/goplus/llgo/c"
func f(s string) bool {
return len(s) > 2
}
func main() {
if s := "hello"; f(s) {
defer c.Printf(c.Str("%s\n"), c.AllocaCStr(s))
} else {
defer c.Printf(c.Str("world\n"))
}
defer c.Printf(c.Str("bye\n"))
}