aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/switch.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2026-03-27 16:20:06 -0700
committerGopher Robot <gobot@golang.org>2026-03-31 11:01:13 -0700
commitd6492e284b61c8be4bfce5ee0ca907f4df5deb72 (patch)
tree2dd97ab6ef6c6ae41d93bcbf21e133ec500f79e8 /test/codegen/switch.go
parent1673075d4bd324e69cb4e6e58760316e2c84e604 (diff)
downloadgo-d6492e284b61c8be4bfce5ee0ca907f4df5deb72.tar.xz
test/codegen: get rid of \s
Replace \s with a space in backtick-quoted strings Replace \\s with a space in double-quoted strings Change-Id: I0c8b249bb12c2c8ca69e683e4bc6f27544fd6094 Reviewed-on: https://go-review.googlesource.com/c/go/+/760680 Auto-Submit: Keith Randall <khr@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Paul Murphy <paumurph@redhat.com> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'test/codegen/switch.go')
-rw-r--r--test/codegen/switch.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/codegen/switch.go b/test/codegen/switch.go
index a8860d0cc4..baa8934e06 100644
--- a/test/codegen/switch.go
+++ b/test/codegen/switch.go
@@ -23,8 +23,8 @@ func f(x string) int {
// use jump tables for 8+ int cases
func square(x int) int {
- // amd64:`JMP\s\(.*\)\(.*\)$`
- // arm64:`MOVD\s\(R.*\)\(R.*<<3\)`,`JMP\s\(R.*\)$`
+ // amd64:`JMP \(.*\)\(.*\)$`
+ // arm64:`MOVD \(R.*\)\(R.*<<3\)`,`JMP \(R.*\)$`
// loong64: `ALSLV`,`MOVV`,`JMP`
switch x {
case 1:
@@ -50,8 +50,8 @@ func square(x int) int {
// use jump tables for 8+ string lengths
func length(x string) int {
- // amd64:`JMP\s\(.*\)\(.*\)$`
- // arm64:`MOVD\s\(R.*\)\(R.*<<3\)`,`JMP\s\(R.*\)$`
+ // amd64:`JMP \(.*\)\(.*\)$`
+ // arm64:`MOVD \(R.*\)\(R.*<<3\)`,`JMP \(R.*\)$`
// loong64:`ALSLV`,`MOVV`,`JMP`
switch x {
case "a":
@@ -78,23 +78,23 @@ func length(x string) int {
// Use single-byte ordered comparisons for binary searching strings.
// See issue 53333.
func mimetype(ext string) string {
- // amd64: `CMPB\s1\(.*\), \$104$`,-`cmpstring`
- // arm64: `MOVB\s1\(R.*\), R.*$`, `CMPW\s\$104, R.*$`, -`cmpstring`
+ // amd64: `CMPB 1\(.*\), \$104$`,-`cmpstring`
+ // arm64: `MOVB 1\(R.*\), R.*$`, `CMPW \$104, R.*$`, -`cmpstring`
switch ext {
- // amd64: `CMPL\s\(.*\), \$1836345390$`
- // arm64: `MOVD\s\$1836345390`, `CMPW\sR.*, R.*$`
+ // amd64: `CMPL \(.*\), \$1836345390$`
+ // arm64: `MOVD \$1836345390`, `CMPW R.*, R.*$`
case ".htm":
return "A"
- // amd64: `CMPL\s\(.*\), \$1953457454$`
- // arm64: `MOVD\s\$1953457454`, `CMPW\sR.*, R.*$`
+ // amd64: `CMPL \(.*\), \$1953457454$`
+ // arm64: `MOVD \$1953457454`, `CMPW R.*, R.*$`
case ".eot":
return "B"
- // amd64: `CMPL\s\(.*\), \$1735815982$`
- // arm64: `MOVD\s\$1735815982`, `CMPW\sR.*, R.*$`
+ // amd64: `CMPL \(.*\), \$1735815982$`
+ // arm64: `MOVD \$1735815982`, `CMPW R.*, R.*$`
case ".svg":
return "C"
- // amd64: `CMPL\s\(.*\), \$1718907950$`
- // arm64: `MOVD\s\$1718907950`, `CMPW\sR.*, R.*$`
+ // amd64: `CMPL \(.*\), \$1718907950$`
+ // arm64: `MOVD \$1718907950`, `CMPW R.*, R.*$`
case ".ttf":
return "D"
default:
@@ -104,8 +104,8 @@ func mimetype(ext string) string {
// use jump tables for type switches to concrete types.
func typeSwitch(x any) int {
- // amd64:`JMP\s\(.*\)\(.*\)$`
- // arm64:`MOVD\s\(R.*\)\(R.*<<3\)`,`JMP\s\(R.*\)$`
+ // amd64:`JMP \(.*\)\(.*\)$`
+ // arm64:`MOVD \(R.*\)\(R.*<<3\)`,`JMP \(R.*\)$`
switch x.(type) {
case int:
return 0