aboutsummaryrefslogtreecommitdiff
path: root/test/nosplit.go
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2020-09-24 13:14:46 -0400
committerThan McIntosh <thanm@google.com>2020-12-22 18:13:48 +0000
commitcb28c96be8b8010dd979e0723bf5a94b11962a93 (patch)
treedab9d1dc34e87cbee006ce3236b82fa364b3d5de /test/nosplit.go
parentc8610e4700bee51898197987de5335b8527079e8 (diff)
downloadgo-cb28c96be8b8010dd979e0723bf5a94b11962a93.tar.gz
go-cb28c96be8b8010dd979e0723bf5a94b11962a93.zip
[dev.regabi] cmd/compile,cmd/link: initial support for ABI wrappers
Add compiler support for emitting ABI wrappers by creating real IR as opposed to introducing ABI aliases. At the moment these are "no-op" wrappers in the sense that they make a simple call (using the existing ABI) to their target. The assumption here is that once late call expansion can handle both ABI0 and the "new" ABIInternal (register version), it can expand the call to do the right thing. Note that the runtime contains functions that do not strictly follow the rules of the current Go ABI0; this has been handled in most cases by treating these as ABIInternal instead (these changes have been made in previous patches). Generation of ABI wrappers (as opposed to ABI aliases) is currently gated by GOEXPERIMENT=regabi -- wrapper generation is on by default if GOEXPERIMENT=regabi is set and off otherwise (but can be turned on using "-gcflags=all=-abiwrap -ldflags=-abiwrap"). Wrapper generation currently only workd on AMD64; explicitly enabling wrapper for other architectures (via the command line) is not supported. Also in this patch are a few other command line options for debugging (tracing and/or limiting wrapper creation). These will presumably go away at some point. Updates #27539, #40724. Change-Id: I1ee3226fc15a3c32ca2087b8ef8e41dbe6df4a75 Reviewed-on: https://go-review.googlesource.com/c/go/+/270863 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Trust: Than McIntosh <thanm@google.com>
Diffstat (limited to 'test/nosplit.go')
-rw-r--r--test/nosplit.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/nosplit.go b/test/nosplit.go
index faa7b8c2d8..8a3fa9bf35 100644
--- a/test/nosplit.go
+++ b/test/nosplit.go
@@ -353,7 +353,14 @@ TestCases:
log.Fatal(err)
}
- cmd := exec.Command("go", "build")
+ // Turn off ABI0 wrapper generation for now. The problem here is
+ // that in these test cases main.main is an assembly routine,
+ // thus calls to it will have to go through an ABI wrapper. The
+ // ABI wrapper will consume some stack space, which throws off
+ // the numbers.
+ workaround := "-gcflags=-abiwrap=0"
+
+ cmd := exec.Command("go", "build", workaround)
cmd.Dir = dir
output, err := cmd.CombinedOutput()
if err == nil {