delve/_fixtures/cgostacktest/main.go

31 lines
386 B
Go
Raw Permalink Normal View History

package main
2018-11-10 17:35:51 +00:00
// #include "hello.h"
import "C"
import (
"fmt"
"runtime"
)
func main() {
runtime.Breakpoint()
C.helloworld(2)
}
//export helloWorld
func helloWorld(x C.int) {
helloWorldS(x)
}
func helloWorldS(x C.int) {
runtime.Breakpoint()
C.helloworld_pt3(x - 1)
}
//export helloWorld2
func helloWorld2(x C.int) {
runtime.Breakpoint()
fmt.Printf("hello world %d\n", x)
}