aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2022-04-04 15:41:08 -0400
committerAustin Clements <austin@google.com>2022-04-19 15:59:25 +0000
commit7a062432059e0a7f6217424733d3a01030897741 (patch)
tree6150fc2daf66df94cce5e348c3b78eb6335b7a39 /test
parent120f445495a573f80b1f0c0acc326c281c01b13e (diff)
downloadgo-7a062432059e0a7f6217424733d3a01030897741.tar.gz
go-7a062432059e0a7f6217424733d3a01030897741.zip
test/nosplit: add more complicated recursion tests
Change-Id: I301ed8bcc93f31147d247e60a7aab8ed42421bbd Reviewed-on: https://go-review.googlesource.com/c/go/+/398175 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test')
-rw-r--r--test/nosplit.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/nosplit.go b/test/nosplit.go
index 1d94f6eb915..7e0fd4e7916 100644
--- a/test/nosplit.go
+++ b/test/nosplit.go
@@ -70,6 +70,18 @@ start 0 call start
start 0 nosplit call start
REJECT
+# Non-trivial recursion runs out of space.
+start 0 call f1
+f1 0 nosplit call f2
+f2 0 nosplit call f1
+REJECT
+# Same but cycle starts below nosplit entry.
+start 0 call f1
+f1 0 nosplit call f2
+f2 0 nosplit call f3
+f3 0 nosplit call f2
+REJECT
+
# Chains of ordinary functions okay.
start 0 call f1
f1 80 call f2
@@ -105,6 +117,14 @@ f8 16 nosplit call end
end 1000
REJECT
+# Two paths both go over the stack limit.
+start 0 call f1
+f1 80 nosplit call f2 call f3
+f2 40 nosplit call f4
+f3 96 nosplit
+f4 40 nosplit
+REJECT
+
# Test cases near the 128-byte limit.
# Ordinary stack split frame is always okay.