build: separate compiler and libs
This commit is contained in:
39
compiler/cl/_testrt/named/in.go
Normal file
39
compiler/cl/_testrt/named/in.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package main
|
||||
|
||||
import "github.com/goplus/llgo/c"
|
||||
|
||||
type mSpanList struct {
|
||||
first *mspan
|
||||
last *mspan
|
||||
}
|
||||
|
||||
type minfo struct {
|
||||
span *mspan
|
||||
info int
|
||||
}
|
||||
|
||||
type mspan struct {
|
||||
next *mspan
|
||||
prev *mspan
|
||||
list *mSpanList
|
||||
info minfo
|
||||
value int
|
||||
check func(int) int
|
||||
}
|
||||
|
||||
func main() {
|
||||
m := &mspan{}
|
||||
m.value = 100
|
||||
m.next = &mspan{}
|
||||
m.next.value = 200
|
||||
m.list = &mSpanList{}
|
||||
m.list.last = &mspan{}
|
||||
m.list.last.value = 300
|
||||
m.info.info = 10
|
||||
m.info.span = m
|
||||
m.check = func(n int) int {
|
||||
return m.value * n
|
||||
}
|
||||
c.Printf(c.Str("%d %d %d %d %d %d\n"), m.next.value, m.list.last.value, m.info.info,
|
||||
m.info.span.value, m.check(-2), m.info.span.check(-3))
|
||||
}
|
||||
Reference in New Issue
Block a user