delve/_fixtures/teststepprog.go
Alessandro Arzilli a31631b5f9
proc/test: fix TestStepCallPtr on linux/386 (#2193)
The test needs to set a breakpoint on main.CallFn after the prologue,
on linux/386 this function does not have any instruction after the
prologue on the function header line  because it doesn't need to
allocate space for local variables. Change the fixture so that this
isn't a problem.

This bug results on the test failing a small percentage of the time.

Co-authored-by: a <a@kra>
2020-10-12 15:07:24 -07:00

23 lines
223 B
Go

package main
var n = 0
func CallFn2(x int) {
n++
}
func CallFn(x int, fn func(x int)) {
fn(x + 1)
}
func CallEface(eface interface{}) {
if eface != nil {
n++
}
}
func main() {
CallFn(0, CallFn2)
CallEface(n)
}