aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2023-09-25 13:42:19 -0700
committerKeith Randall <khr@golang.org>2023-10-09 17:28:22 +0000
commitafd7c15c7f2d5ffd7e5f6234d76cc6698f86c06e (patch)
tree72e40044a6746c27edd41b708f687779ee47f061 /test/codegen
parent7fcc626b577ecd17f5b4a770671b265d3a850a49 (diff)
downloadgo-afd7c15c7f2d5ffd7e5f6234d76cc6698f86c06e.tar.xz
cmd/compile: use cache in front of convI2I
This is the last of the getitab users to receive a cache. We should now no longer see getitab (and callees) in profiles. Hopefully. Change-Id: I2ed72b9943095bbe8067c805da7f08e00706c98c Reviewed-on: https://go-review.googlesource.com/c/go/+/531055 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/switch.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/codegen/switch.go b/test/codegen/switch.go
index b0186ba5b7..4103bf5297 100644
--- a/test/codegen/switch.go
+++ b/test/codegen/switch.go
@@ -125,6 +125,10 @@ type I interface {
type J interface {
bar()
}
+type IJ interface {
+ I
+ J
+}
// use a runtime call for type switches to interface types.
func interfaceSwitch(x any) int {
@@ -148,3 +152,9 @@ func interfaceCast(x any) int {
}
return 5
}
+
+func interfaceConv(x IJ) I {
+ // amd64:`CALL\truntime.typeAssert`,`MOVL\t16\(.*\)`,`MOVQ\t8\(.*\)(.*\*1)`
+ // arm64:`CALL\truntime.typeAssert`,`LDAR`,`MOVWU`,`MOVD\t\(R.*\)\(R.*\)`
+ return x
+}