mirror of https://github.com/golang/go.git
test: relax whitespaces matching in codegen tests
The codegen testsuite uses regexp to parse the syntax, but it doesn't have a way to tell line comments containing checks from line comments containing English sentences. This means that any syntax error (that is, non-matching regexp) is currently ignored and not reported. There were some tests in memcombine.go that had an extraneous space and were thus effectively disabled. It would be great if we could report it as a syntax error, but for now we just punt and swallow the spaces as a workaround, to avoid the same mistake again. Fixes #25452 Change-Id: Ic7747a2278bc00adffd0c199ce40937acbbc9cf0 Reviewed-on: https://go-review.googlesource.com/113835 Run-TryBot: Giovanni Bajo <rasky@develer.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
c9cc20bd3a
commit
f02cc88f46
|
|
@ -503,7 +503,7 @@ func zero_byte_16(b []byte) {
|
|||
|
||||
/* TODO: enable them when corresponding optimization are implemented
|
||||
func zero_byte_4_idx(b []byte, idx int) {
|
||||
// arm64: `MOVW\sZR,\s\(R[0-9]+\)\(R[0-9]+<<2\)`,-`MOV[BH]`
|
||||
// arm64(DISABLED): `MOVW\sZR,\s\(R[0-9]+\)\(R[0-9]+<<2\)`,-`MOV[BH]`
|
||||
b[(idx<<2)+0] = 0
|
||||
b[(idx<<2)+1] = 0
|
||||
b[(idx<<2)+2] = 0
|
||||
|
|
@ -511,7 +511,7 @@ func zero_byte_4_idx(b []byte, idx int) {
|
|||
}
|
||||
|
||||
func zero_byte_8_idx(b []byte, idx int) {
|
||||
// arm64: `MOVD\sZR,\s\(R[0-9]+\)\(R[0-9]+<<3\)`,-`MOV[BHW]`
|
||||
// arm64(DISABLED): `MOVD\sZR,\s\(R[0-9]+\)\(R[0-9]+<<3\)`,-`MOV[BHW]`
|
||||
b[(idx<<3)+0] = 0
|
||||
b[(idx<<3)+1] = 0
|
||||
b[(idx<<3)+2] = 0
|
||||
|
|
|
|||
|
|
@ -1329,11 +1329,12 @@ const (
|
|||
|
||||
var (
|
||||
// Regexp to split a line in code and comment, trimming spaces
|
||||
rxAsmComment = regexp.MustCompile(`^\s*(.*?)\s*(?:\/\/\s*(.+)\s*)?$`)
|
||||
rxAsmComment = regexp.MustCompile(`^\s*(.*?)\s*(?://\s*(.+)\s*)?$`)
|
||||
|
||||
// Regexp to extract an architecture check: architecture name, followed by semi-colon,
|
||||
// followed by a comma-separated list of opcode checks.
|
||||
rxAsmPlatform = regexp.MustCompile(`(\w+)(/\w+)?(/\w*)?:(` + reMatchCheck + `(?:,` + reMatchCheck + `)*)`)
|
||||
// Regexp to extract an architecture check: architecture name (or triplet),
|
||||
// followed by semi-colon, followed by a comma-separated list of opcode checks.
|
||||
// Extraneous spaces are ignored.
|
||||
rxAsmPlatform = regexp.MustCompile(`(\w+)(/\w+)?(/\w*)?\s*:\s*(` + reMatchCheck + `(?:\s*,\s*` + reMatchCheck + `)*)`)
|
||||
|
||||
// Regexp to extract a single opcoded check
|
||||
rxAsmCheck = regexp.MustCompile(reMatchCheck)
|
||||
|
|
|
|||
Loading…
Reference in New Issue