Commit b4c3fe7b authored by David Chase's avatar David Chase

cmd/compile: adjust expectations of test for issue 18902

The test for #18902 reads the assembly stream to be sure
that the line number does not change too often (this is an
indication that debugging the code will be unpleasant and
that the compiler is probably getting line numbers "wrong").

It checks that it is getting "enough" input, but the
compiler has gotten enough better since the test was written
that it now fails for lack of enough input.  The old
threshould was 200 instructions, the new one is 150 (the
minimum observed input is on arm64 with 184 instructions).

Fixes #22494.

Change-Id: Ibba7e9ff4ab6a7be369e5dd5859d150b7db94653
Reviewed-on: https://go-review.googlesource.com/74357
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarAustin Clements <austin@google.com>
parent 0153a413
......@@ -56,7 +56,10 @@ func main() {
cmd.Stderr = &buf
cmd.Env = os.Environ()
updateEnv(&cmd.Env, "GOARCH", testarch)
if testarch != "" {
updateEnv(&cmd.Env, "GOARCH", testarch)
updateEnv(&cmd.Env, "GOOS", "linux") // Simplify multi-arch testing
}
err := cmd.Run()
if err != nil {
......@@ -89,8 +92,9 @@ func main() {
i = strings.Index(line, beforeLineNumber)
if i < 0 {
// Done reading lines
if scannedCount < 200 { // When test was written, 251 lines observed on amd64
fmt.Printf("Scanned only %d lines, was expecting more than 200", scannedCount)
const minLines = 150
if scannedCount <= minLines { // When test was written, 251 lines observed on amd64; arm64 now obtains 184
fmt.Printf("Scanned only %d lines, was expecting more than %d\n", int(scannedCount), minLines)
return
}
// Note: when test was written, before changes=92, after=50 (was 62 w/o rematerialization NoXPos in *Value.copyInto())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment