| 1 |
This test exercises the Definition request in a Go assembly file. |
| 2 |
|
| 3 |
For now we support only references to package-level symbols defined in |
| 4 |
the same package or a dependency. |
| 5 |
|
| 6 |
Repeatedly jumping to Definition on ff ping-pongs between the Go and |
| 7 |
assembly declarations. |
| 8 |
|
| 9 |
-- go.mod -- |
| 10 |
module example.com |
| 11 |
go 1.18 |
| 12 |
|
| 13 |
-- a/a.go -- |
| 14 |
package a |
| 15 |
|
| 16 |
import _ "fmt" |
| 17 |
import _ "example.com/b" |
| 18 |
|
| 19 |
func ff() //@ loc(ffgo, "ff"), def("ff", ffasm) |
| 20 |
|
| 21 |
var _ = ff // pacify unusedfunc analyzer |
| 22 |
|
| 23 |
-- a/asm.s -- |
| 24 |
// portable assembly |
| 25 |
|
| 26 |
TEXT ·ff(SB), $16 //@ loc(ffasm, "ff"), def("ff", ffgo) |
| 27 |
CALL example·com∕b·B //@ def("com", bB) |
| 28 |
JMP ·ff //@ def("ff", ffgo) |
| 29 |
JMP label //@ def("label", label) |
| 30 |
label: //@ loc(label,"label") |
| 31 |
RET |
| 32 |
|
| 33 |
-- b/b.go -- |
| 34 |
package b |
| 35 |
|
| 36 |
func B() {} //@ loc(bB, "B") |