1 // Copyright 2022 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
16 var pc0, pc1 [1]uintptr
17 runtime.Callers(1, pc0[:]) // get PC at entry
19 // a switch using jump table
41 // check PC is in the same function
42 runtime.Callers(1, pc1[:])
43 if pc1[0] < pc0[0] || pc1[0] > pc0[0]+1000000 {
44 fmt.Printf("jump across DSO boundary. pc0=%x, pc1=%x\n", pc0[0], pc1[0])
49 fmt.Printf("x=%d y=%d!=%d\n", x, y, x*x)