1// errorcheck -0 -+ -p=runtime -m
2
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.
6
7package runtime
8
9// A function that calls runtime.getcallerpc or runtime.getcallersp()
10// cannot be inlined, no matter how small it is.
11
12func getcallerpc() uintptr
13func getcallersp() uintptr
14
15func pc() uintptr {
16	return getcallerpc() + 1
17}
18
19func cpc() uintptr { // ERROR "can inline cpc"
20	return pc() + 2
21}
22
23func sp() uintptr {
24	return getcallersp() + 3
25}
26
27func csp() uintptr { // ERROR "can inline csp"
28	return sp() + 4
29}
30