From: David Chase Date: Mon, 30 Oct 2017 15:39:29 +0000 (-0400) Subject: cmd/compile: adjust expectations of test for issue 18902 X-Git-Tag: go1.10beta1~529 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b4c3fe7b049f79f81fae52d5006aa29b926bb4e0;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- diff --git a/test/fixedbugs/issue18902.go b/test/fixedbugs/issue18902.go index f5bca16a32..9b85503eca 100644 --- a/test/fixedbugs/issue18902.go +++ b/test/fixedbugs/issue18902.go @@ -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())