3 // Copyright 2020 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 // Tests that errors are reported for misuse of linkname.
18 // ERROR "//go:linkname must refer to declared function or variable"
19 // ERROR "//go:linkname must refer to declared function or variable"
20 // ERROR "duplicate //go:linkname for x"
22 //line linkname3.go:18
23 //go:linkname nonexist nonexist
24 //go:linkname t notvarfunc
25 //go:linkname x duplicate