From 1582ad41058df1092eaed9dec4d97b7856953ade Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 27 Mar 2026 17:14:43 -0700 Subject: [PATCH] test/codegen: fix some unbalanced quotes Change-Id: I081da8c79f0264118e079af21ff58c511ae37e6c Reviewed-on: https://go-review.googlesource.com/c/go/+/760682 Reviewed-by: Junyang Shao LUCI-TryBot-Result: Go LUCI Reviewed-by: Joel Sing Reviewed-by: Keith Randall Auto-Submit: Keith Randall --- src/cmd/internal/testdir/testdir_test.go | 2 ++ test/codegen/arithmetic.go | 2 +- test/codegen/memcombine.go | 2 +- test/codegen/memops_bigoffset.go | 4 ++-- test/codegen/multiply.go | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cmd/internal/testdir/testdir_test.go b/src/cmd/internal/testdir/testdir_test.go index e4d5b5d70b..18891f0081 100644 --- a/src/cmd/internal/testdir/testdir_test.go +++ b/src/cmd/internal/testdir/testdir_test.go @@ -1683,6 +1683,8 @@ func (t test) wantedAsmOpcodes(fn string) asmChecks { tail := comment[lastUsed:] if possibleOpcodeRx.MatchString(tail) { t.Errorf("%s:%d: possible unused assembly pattern: %v", t.goFileName(), i+1, tail) + } else if strings.Count(comment, "\"")%2 != 0 || strings.Count(comment, "`")%2 != 0 { + t.Errorf("%s:%d: unbalanced quotes: %v", t.goFileName(), i+1, comment) } } comment = "" diff --git a/test/codegen/arithmetic.go b/test/codegen/arithmetic.go index b48975cc13..f8a2fc5400 100644 --- a/test/codegen/arithmetic.go +++ b/test/codegen/arithmetic.go @@ -606,7 +606,7 @@ func LenDiv1(a []int) int { // amd64:"SHRQ [$]10" // arm64:"LSR [$]10" -"SDIV" // arm:"SRL [$]10" -".*udiv" - // ppc64x:"SRD" [$]10" + // ppc64x:"SRD [$]10" return len(a) / 1024 } diff --git a/test/codegen/memcombine.go b/test/codegen/memcombine.go index 9df22c1109..f2f57fffe4 100644 --- a/test/codegen/memcombine.go +++ b/test/codegen/memcombine.go @@ -429,7 +429,7 @@ func store_le64(b []byte, x uint64) { // amd64:`MOVQ .*\(.*\)$` -`SHR.` // arm64:`MOVD` -`MOV[WBH]` // ppc64le:`MOVD ` -`MOV[BHW] ` - // ppc64:`MOVDBR` -MOVB ` + // ppc64:`MOVDBR` -`MOVB ` // s390x:`MOVDBR .*\(.*\)$` binary.LittleEndian.PutUint64(b, x) } diff --git a/test/codegen/memops_bigoffset.go b/test/codegen/memops_bigoffset.go index 74dd198890..ef9ccae555 100644 --- a/test/codegen/memops_bigoffset.go +++ b/test/codegen/memops_bigoffset.go @@ -33,7 +33,7 @@ func loadLargeOffset(sw *big1, sd *big2) (uint32, uint64) { // ppc64x/power9:`ADD` `MOVD +\(R[0-9]+\), R[0-9]+` // ppc64x/power8:`ADD` `MOVD +\(R[0-9]+\), R[0-9]+` b4 := sd.d[1<<16] - // ppc64le/power10`:`MOVD +[0-9]+\(R[0-9]+\)` -`ADD` + // ppc64le/power10:`MOVD +[0-9]+\(R[0-9]+\)` -`ADD` // ppc64x/power9:`ADD` `MOVD +\(R[0-9]+\), R[0-9]+` // ppc64x/power8:`ADD` `MOVD +\(R[0-9]+\), R[0-9]+` c4 := sd.d[1<<27] @@ -62,7 +62,7 @@ func storeLargeOffset(sw *big1, sd *big2) { // ppc64x/power9:`MOVD +R[0-9]+, \(R[0-9]+\)` `ADD` // ppc64x/power8:`MOVD +R[0-9]+, \(R[0-9]+\)` `ADD` sd.d[1<<16] = uint64(50) - // ppc64le/power10`:`MOVD +R[0-9]+, [0-9]+\(R[0-9]+\)` -`ADD` + // ppc64le/power10:`MOVD +R[0-9]+, [0-9]+\(R[0-9]+\)` -`ADD` // ppc64x/power9:`MOVD +R[0-9]+, \(R[0-9]+\)` `ADD` // ppc64x/power8:`MOVD +R[0-9]+, \(R[0-9]+\)` `ADD` sd.d[1<<27] = uint64(60) diff --git a/test/codegen/multiply.go b/test/codegen/multiply.go index 3b88a1179f..8c76fd9bb1 100644 --- a/test/codegen/multiply.go +++ b/test/codegen/multiply.go @@ -173,7 +173,7 @@ func m27(x int64) int64 { } func m28(x int64) int64 { // amd64: "IMUL3Q [$]28," - // arm64: "LSL [$]5, "SUB R[0-9]+<<2," + // arm64: "LSL [$]5," "SUB R[0-9]+<<2," // loong64: "ALSLV [$]1," "SLLV [$]2," "ALSLV [$]3," return x * 28 }