cl: go:linkname specifies call convention by C.xxx

This commit is contained in:
xushiwei
2024-04-26 13:09:24 +08:00
parent 33716a3385
commit f86cd74a98
9 changed files with 27 additions and 13 deletions

View File

@@ -30,13 +30,23 @@ func TestIgnoreName(t *testing.T) {
}
}
func TestImport(t *testing.T) {
func TestErrImport(t *testing.T) {
var ctx context
pkg := types.NewPackage("foo", "foo")
ctx.importPkg(pkg)
}
func TestVarOf(t *testing.T) {
func TestErrInitLinkname(t *testing.T) {
defer func() {
if r := recover(); r == nil {
t.Fatal("initLinkname: no error?")
}
}()
var ctx context
ctx.initLinkname("foo", "//go:linkname Printf printf")
}
func TestErrVarOf(t *testing.T) {
defer func() {
if r := recover(); r == nil {
t.Fatal("varOf: no error?")