diff options
| author | Youlin Feng <fengyoulin@live.com> | 2025-07-29 18:53:29 +0800 |
|---|---|---|
| committer | Jorropo <jorropo.pgm@gmail.com> | 2025-07-30 09:38:10 -0700 |
| commit | cc571dab91e73413cf2ba1546a4ba485038cf2d1 (patch) | |
| tree | 5d2a30eb8256fc77a5273fa20aea43a92b712240 /test/codegen | |
| parent | 2174a7936c9e6109e2786369072f5b9dc5d631f5 (diff) | |
| download | go-cc571dab91e73413cf2ba1546a4ba485038cf2d1.tar.xz | |
cmd/compile: deduplicate instructions when rewrite func results
After CL 628075, do not rely on the memory arg of an OpLocalAddr.
Fixes #74788
Change-Id: I4e893241e3949bb8f2d93c8b88cc102e155b725d
Reviewed-on: https://go-review.googlesource.com/c/go/+/691275
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Mark Freeman <mark@golang.org>
Diffstat (limited to 'test/codegen')
| -rw-r--r-- | test/codegen/README | 7 | ||||
| -rw-r--r-- | test/codegen/issue74788.go | 17 |
2 files changed, 24 insertions, 0 deletions
diff --git a/test/codegen/README b/test/codegen/README index 19a73d031c..33b9fbc49c 100644 --- a/test/codegen/README +++ b/test/codegen/README @@ -98,6 +98,13 @@ For example: verifies that NO memmove call is present in the assembly generated for the copy() line. +The expected number of matches for the regexp can be specified using a +positive number: + + func fb(a [4]int) (r [4]int) { + // amd64:2`MOVUPS[^,]+, X0$`,2`MOVUPS\sX0,[^\n]+$` + return a + } - Architecture specifiers diff --git a/test/codegen/issue74788.go b/test/codegen/issue74788.go new file mode 100644 index 0000000000..d04a89b42e --- /dev/null +++ b/test/codegen/issue74788.go @@ -0,0 +1,17 @@ +// 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 + +func fa(a [2]int) (r [2]int) { + // amd64:1`MOVUPS[^,]+, X0$`,1`MOVUPS\sX0,[^\n]+$` + return a +} + +func fb(a [4]int) (r [4]int) { + // amd64:2`MOVUPS[^,]+, X0$`,2`MOVUPS\sX0,[^\n]+$` + return a +} |
