Source file test/codegen/load_type_from_itab.go

     1  // asmcheck
     2  
     3  // Copyright 2025 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.
     6  
     7  // This test makes sure that we statically load a type from an itab, instead
     8  // of doing a indirect load from thet itab.
     9  
    10  package codegen
    11  
    12  type M interface{ M() }
    13  type A interface{ A() }
    14  
    15  type Impl struct{}
    16  
    17  func (*Impl) M() {}
    18  func (*Impl) A() {}
    19  
    20  func main() {
    21  	var a M = &Impl{}
    22  	// amd64:`LEAQ\ttype:.*Impl`
    23  	a.(A).A()
    24  }
    25  

View as plain text