build: separate compiler and libs
This commit is contained in:
26
compiler/cl/_testrt/tpfunc/in.go
Normal file
26
compiler/cl/_testrt/tpfunc/in.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type Func func(*int)
|
||||
|
||||
//llgo:type C
|
||||
type CFunc func(*int)
|
||||
|
||||
//llgo:type C
|
||||
type Callback[T any] func(*T)
|
||||
|
||||
func main() {
|
||||
var fn1 Func = func(v *int) {
|
||||
println(*v)
|
||||
}
|
||||
var fn2 CFunc = func(v *int) {
|
||||
println(*v)
|
||||
}
|
||||
var fn3 Callback[int] = func(v *int) {
|
||||
println(*v)
|
||||
}
|
||||
println(unsafe.Sizeof(fn1), unsafe.Sizeof(fn2), unsafe.Sizeof(fn3))
|
||||
}
|
||||
Reference in New Issue
Block a user