Skip to content

Commit 7a06243

Browse files
committed
test/nosplit: add more complicated recursion tests
Change-Id: I301ed8bcc93f31147d247e60a7aab8ed42421bbd Reviewed-on: https://go-review.googlesource.com/c/go/+/398175 Run-TryBot: Austin Clements <[email protected]> Reviewed-by: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 120f445 commit 7a06243

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/nosplit.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ start 0 call start
7070
start 0 nosplit call start
7171
REJECT
7272
73+
# Non-trivial recursion runs out of space.
74+
start 0 call f1
75+
f1 0 nosplit call f2
76+
f2 0 nosplit call f1
77+
REJECT
78+
# Same but cycle starts below nosplit entry.
79+
start 0 call f1
80+
f1 0 nosplit call f2
81+
f2 0 nosplit call f3
82+
f3 0 nosplit call f2
83+
REJECT
84+
7385
# Chains of ordinary functions okay.
7486
start 0 call f1
7587
f1 80 call f2
@@ -105,6 +117,14 @@ f8 16 nosplit call end
105117
end 1000
106118
REJECT
107119
120+
# Two paths both go over the stack limit.
121+
start 0 call f1
122+
f1 80 nosplit call f2 call f3
123+
f2 40 nosplit call f4
124+
f3 96 nosplit
125+
f4 40 nosplit
126+
REJECT
127+
108128
# Test cases near the 128-byte limit.
109129
110130
# Ordinary stack split frame is always okay.

0 commit comments

Comments
 (0)