mirror of https://github.com/golang/go.git
add test
Change-Id: I0db78c67fcb1e7f2f2aaeed06a54414e634e8ab3
This commit is contained in:
parent
ea879c683e
commit
4bfc901917
|
|
@ -0,0 +1,24 @@
|
|||
// asmcheck
|
||||
|
||||
// Copyright 2025 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// This test makes sure that we statically load a type from an itab, instead
|
||||
// of doing a indirect load from thet itab.
|
||||
|
||||
package codegen
|
||||
|
||||
type M interface{ M() }
|
||||
type A interface{ A() }
|
||||
|
||||
type Impl struct{}
|
||||
|
||||
func (*Impl) M() {}
|
||||
func (*Impl) A() {}
|
||||
|
||||
func main() {
|
||||
var a M = &Impl{}
|
||||
// amd64:`LEAQ\ttype:.*Impl`
|
||||
a.(A).A()
|
||||
}
|
||||
Loading…
Reference in New Issue