1
0
mirror of https://github.com/golang/go synced 2024-11-26 02:07:57 -07:00

[dev.regabi] cmd/compile: add type assertion in regabi test

Change-Id: I7da5165f3679736040be5bfbcea3d4a85deaff2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/277957
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Russ Cox 2020-12-14 13:20:06 -05:00
parent 9c384e881e
commit 88e1415d08

View File

@ -75,10 +75,7 @@ func tokenize(src string) []string {
}
func verifyParamResultOffset(t *testing.T, f *types.Field, r ABIParamAssignment, which string, idx int) int {
n := ir.AsNode(f.Nname)
if n == nil {
panic("not expected")
}
n := ir.AsNode(f.Nname).(*ir.Name)
if n.Offset() != int64(r.Offset) {
t.Errorf("%s %d: got offset %d wanted %d t=%v",
which, idx, r.Offset, n.Offset(), f.Type)