diff options
Diffstat (limited to 'test/nosplit.go')
-rw-r--r-- | test/nosplit.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/test/nosplit.go b/test/nosplit.go index 953a5bf0a..3a63e8731 100644 --- a/test/nosplit.go +++ b/test/nosplit.go @@ -127,8 +127,9 @@ main 136 nosplit; REJECT # Calling a nosplit function from a nosplit function requires # having room for the saved caller PC and the called frame. # Because ARM doesn't save LR in the leaf, it gets an extra 4 bytes. +# Because Power64 doesn't save LR in the leaf, it gets an extra 8 bytes. main 112 nosplit call f; f 0 nosplit -main 116 nosplit call f; f 0 nosplit; REJECT amd64 +main 116 nosplit call f; f 0 nosplit main 120 nosplit call f; f 0 nosplit; REJECT amd64 main 124 nosplit call f; f 0 nosplit; REJECT amd64 386 main 128 nosplit call f; f 0 nosplit; REJECT @@ -137,8 +138,8 @@ main 136 nosplit call f; f 0 nosplit; REJECT # Calling a splitting function from a nosplit function requires # having room for the saved caller PC of the call but also the -# saved caller PC for the call to morestack. Again the ARM works -# in less space. +# saved caller PC for the call to morestack. +# Again the ARM and Power64 work in less space. main 104 nosplit call f; f 0 call f main 108 nosplit call f; f 0 call f main 112 nosplit call f; f 0 call f; REJECT amd64 @@ -234,9 +235,17 @@ TestCases: fmt.Fprintf(&gobuf, "package main\n") var buf bytes.Buffer - if goarch == "arm" { + ptrSize := 4 + switch goarch { + case "power64", "power64le": + ptrSize = 8 + fmt.Fprintf(&buf, "#define CALL BL\n#define REGISTER (CTR)\n#define RET RETURN\n") + case "arm": fmt.Fprintf(&buf, "#define CALL BL\n#define REGISTER (R0)\n") - } else { + case "amd64": + ptrSize = 8 + fmt.Fprintf(&buf, "#define REGISTER AX\n") + default: fmt.Fprintf(&buf, "#define REGISTER AX\n") } @@ -266,7 +275,7 @@ TestCases: size += 384 - 128 } - if goarch == "amd64" && size%8 == 4 { + if size%ptrSize == 4 { continue TestCases } nosplit := m[3] |