src/cmd/link/testdata/linkname/fastrand.go
raw| 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 | // Linkname fastrand is allowed _for now_, as it has a |
| 6 | // linknamed definition, for legacy reason. |
| 7 | // NOTE: this may not be allowed in the future. Don't do this! |
| 8 | |
| 9 | package main |
| 10 | |
| 11 | import _ "unsafe" |
| 12 | |
| 13 | //go:linkname fastrand runtime.fastrand |
| 14 | func fastrand() uint32 |
| 15 | |
| 16 | func main() { |
| 17 | println(fastrand()) |
| 18 | } |