build: separate compiler and libs
This commit is contained in:
17
compiler/cl/_testlibc/defer/in.go
Normal file
17
compiler/cl/_testlibc/defer/in.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import "github.com/goplus/llgo/c"
|
||||
|
||||
func f(s string) bool {
|
||||
return len(s) > 2
|
||||
}
|
||||
|
||||
func main() {
|
||||
c.GoDeferData()
|
||||
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"))
|
||||
}
|
||||
Reference in New Issue
Block a user