| 1 |
// Copyright 2024 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. |
| 4 |
|
| 5 |
// Test that a linkname applied on an assembly declaration |
| 6 |
// does not affect stack map generation. |
| 7 |
|
| 8 |
package main |
| 9 |
|
| 10 |
import ( |
| 11 |
"runtime" |
| 12 |
_ "unsafe" |
| 13 |
) |
| 14 |
|
| 15 |
//go:linkname asm |
| 16 |
func asm(*int) |
| 17 |
|
| 18 |
func main() { |
| 19 |
x := new(int) |
| 20 |
asm(x) |
| 21 |
} |
| 22 |
|
| 23 |
// called from asm |
| 24 |
func callback() { |
| 25 |
runtime.GC() // scan stack |
| 26 |
} |