diff --git a/src/cmd/compile/internal/ssa/stmtlines_test.go b/src/cmd/compile/internal/ssa/stmtlines_test.go index a94ff9c994..673c88a600 100644 --- a/src/cmd/compile/internal/ssa/stmtlines_test.go +++ b/src/cmd/compile/internal/ssa/stmtlines_test.go @@ -118,12 +118,17 @@ func TestStmtLines(t *testing.T) { } } + var m int if runtime.GOARCH == "amd64" { - if len(nonStmtLines)*100 > len(lines) { // > 99% obtained on amd64, no backsliding - t.Errorf("Saw too many (amd64, > 1%%) lines without statement marks, total=%d, nostmt=%d ('-run TestStmtLines -v' lists failing lines)\n", len(lines), len(nonStmtLines)) - } - } else if len(nonStmtLines)*100 > 2*len(lines) { // expect 98% elsewhere. - t.Errorf("Saw too many (not amd64, > 2%%) lines without statement marks, total=%d, nostmt=%d ('-run TestStmtLines -v' lists failing lines)\n", len(lines), len(nonStmtLines)) + m = 1 // > 99% obtained on amd64, no backsliding + } else if runtime.GOARCH == "riscv64" { + m = 3 // XXX temporary update threshold to 97% for regabi + } else { + m = 2 // expect 98% elsewhere. + } + + if len(nonStmtLines)*100 > m*len(lines) { + t.Errorf("Saw too many (%s, > %d%%) lines without statement marks, total=%d, nostmt=%d ('-run TestStmtLines -v' lists failing lines)\n", runtime.GOARCH, m, len(lines), len(nonStmtLines)) } t.Logf("Saw %d out of %d lines without statement marks", len(nonStmtLines), len(lines)) if testing.Verbose() {