mirror of
https://github.com/golang/go
synced 2025-09-18 07:39:28 +00:00
This CL makes the generated code for reflect.TypeFor as simple as an intrinsic function. Fixes #75203 Change-Id: I7bb48787101f07e77ab5c583292e834c28a028d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/700336 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Keith Randall <khr@golang.org>
23 lines
486 B
Go
23 lines
486 B
Go
// 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.
|
|
|
|
package codegen
|
|
|
|
import "reflect"
|
|
|
|
func f() reflect.Type {
|
|
// amd64:`LEAQ\stype:\*int\(SB\)`
|
|
// arm64:`MOVD\s\$type:\*int\(SB\)`
|
|
return reflect.TypeFor[*int]()
|
|
}
|
|
|
|
func g() reflect.Type {
|
|
// amd64:`LEAQ\stype:int\(SB\)`
|
|
// arm64:`MOVD\s\$type:int\(SB\)`
|
|
return reflect.TypeFor[int]()
|
|
}
|
|
|