aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/switch.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/codegen/switch.go')
-rw-r--r--test/codegen/switch.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/codegen/switch.go b/test/codegen/switch.go
index af3762869a..c3c24e2e11 100644
--- a/test/codegen/switch.go
+++ b/test/codegen/switch.go
@@ -72,3 +72,30 @@ func length(x string) int {
return len(x)
}
}
+
+// 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`
+ switch ext {
+ // amd64: `CMPL\s\(.*\), \$1836345390$`
+ // arm64: `CMPW\s\$1836345390, R.*$`
+ case ".htm":
+ return "A"
+ // amd64: `CMPL\s\(.*\), \$1953457454$`
+ // arm64: `CMPW\s\$1953457454, R.*$`
+ case ".eot":
+ return "B"
+ // amd64: `CMPL\s\(.*\), \$1735815982$`
+ // arm64: `CMPW\s\$1735815982, R.*$`
+ case ".svg":
+ return "C"
+ // amd64: `CMPL\s\(.*\), \$1718907950$`
+ // arm64: `CMPW\s\$1718907950, R.*$`
+ case ".ttf":
+ return "D"
+ default:
+ return ""
+ }
+}