3 // Copyright 2019 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Make sure FuncForPC won't panic when given a pc which
8 // lies between two functions.
18 runtime.Callers(1, stack[:])
19 f() // inlined function, to give main some inlining info
20 for i := uintptr(0); true; i++ {
21 f := runtime.FuncForPC(stack[0] + i)
22 if f.Name() != "main.main" && f.Name() != "main.f" {
23 // Reached next function successfully.
30 sink = 0 // one instruction which can't be removed