aboutsummaryrefslogtreecommitdiff
path: root/test/live_regabi.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2023-01-20 13:54:36 -0800
committerKeith Randall <khr@google.com>2023-01-21 21:08:30 +0000
commitba913774543d7388b7bb1843fc7c1b935aebedda (patch)
treeb5b82130bf3035db24bc1f07deb6d2c0f85352b8 /test/live_regabi.go
parent4ff074945a4848cd04c020b7f20ddaa1d78cc548 (diff)
downloadgo-ba913774543d7388b7bb1843fc7c1b935aebedda.tar.gz
go-ba913774543d7388b7bb1843fc7c1b935aebedda.zip
test: test that we schedule OpArgIntReg early
If OpArgIntReg is incorrectly scheduled, that causes it to be spilled incorrectly, which causes the argument to not be considered live at the start of the function. This is the test for CL 462858 Add a brief mention of why CL 462858 is needed in the scheduling code. Change-Id: Id199456f88d9ee5ca46d7b0353a3c2049709880e Reviewed-on: https://go-review.googlesource.com/c/go/+/462899 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Keith Randall <khr@golang.org>
Diffstat (limited to 'test/live_regabi.go')
-rw-r--r--test/live_regabi.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/live_regabi.go b/test/live_regabi.go
index 6a8ff5d68a..bae319d2fd 100644
--- a/test/live_regabi.go
+++ b/test/live_regabi.go
@@ -11,6 +11,8 @@
package main
+import "runtime"
+
func printnl()
//go:noescape
@@ -718,3 +720,23 @@ func f44(f func() [2]*int) interface{} { // ERROR "live at entry to f44: f"
ret.s[0] = f()
return ret
}
+
+func f45(a, b, c, d, e, f, g, h, i, j, k, l *byte) { // ERROR "live at entry to f45: a b c d e f g h i j k l"
+ f46(a, b, c, d, e, f, g, h, i, j, k, l) // ERROR "live at call to f46: a b c d e f g h i j k l"
+ runtime.KeepAlive(a)
+ runtime.KeepAlive(b)
+ runtime.KeepAlive(c)
+ runtime.KeepAlive(d)
+ runtime.KeepAlive(e)
+ runtime.KeepAlive(f)
+ runtime.KeepAlive(g)
+ runtime.KeepAlive(h)
+ runtime.KeepAlive(i)
+ runtime.KeepAlive(j)
+ runtime.KeepAlive(k)
+ runtime.KeepAlive(l)
+}
+
+//go:noinline
+func f46(a, b, c, d, e, f, g, h, i, j, k, l *byte) {
+}