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
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
}
}
- if size%ptrSize == 4 {
- continue TestCases
- }
- nosplit := m[3]
- body := m[4]
-
if nosplit != "" {
nosplit = ",7"
} else {