From d6492e284b61c8be4bfce5ee0ca907f4df5deb72 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 27 Mar 2026 16:20:06 -0700 Subject: 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 Reviewed-by: Junyang Shao Reviewed-by: Paul Murphy Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI --- test/codegen/switch.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'test/codegen/switch.go') 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 -- cgit v1.3