diff --git a/test/nosplit.go b/test/nosplit.go index 7c7e1bfd99..1d94f6eb91 100644 --- a/test/nosplit.go +++ b/test/nosplit.go @@ -292,12 +292,13 @@ TestCases: fmt.Fprintf(&gobuf, "func main() { main0() }\n") fmt.Fprintf(&buf, "TEXT ·main0(SB),0,$0-0\n\tCALL ·start(SB)\n") + adjusted := false for _, line := range strings.Split(lines, "\n") { line = strings.TrimSpace(line) if line == "" { continue } - for i, subline := range strings.Split(line, ";") { + for _, subline := range strings.Split(line, ";") { subline = strings.TrimSpace(subline) if subline == "" { continue @@ -311,10 +312,19 @@ TestCases: name := m[1] size, _ := strconv.Atoi(m[2]) + if size%ptrSize == 4 { + continue TestCases + } + nosplit := m[3] + body := m[4] + // The limit was originally 128 but is now 800 (928-128). // Instead of rewriting the test cases above, adjust - // the first stack frame to use up the extra bytes. - if i == 0 { + // the first nosplit frame to use up the extra bytes. + // This isn't exactly right because we could have + // nosplit -> split -> nosplit, but it's good enough. + if !adjusted && nosplit != "" { + adjusted = true size += (928 - 128) - 128 // Noopt builds have a larger stackguard. // See ../src/cmd/dist/buildruntime.go:stackGuardMultiplier @@ -326,12 +336,6 @@ TestCases: } } - if size%ptrSize == 4 { - continue TestCases - } - nosplit := m[3] - body := m[4] - if nosplit != "" { nosplit = ",7" } else {