]> Cypherpunks.ru repositories - gostls13.git/commitdiff
test/nosplit: add more complicated recursion tests
authorAustin Clements <austin@google.com>
Mon, 4 Apr 2022 19:41:08 +0000 (15:41 -0400)
committerAustin Clements <austin@google.com>
Tue, 19 Apr 2022 15:59:25 +0000 (15:59 +0000)
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>

test/nosplit.go

index 1d94f6eb915ee02ac2d8a9e6e7bc7c5c9f3515a1..7e0fd4e7916e8984cb1826f0413e8ca9a9805af2 100644 (file)
@@ -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.