0
1
mirror of https://github.com/golang/go synced 2025-09-18 07:39:28 +00:00
Files
go/test/codegen/issue75203.go
Youlin Feng df29038486 cmd/compile/internal/ssa: load constant values from abi.PtrType.Elem
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>
2025-09-04 07:25:26 -07:00

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]()
}