Change-Id: If2887f84b3d14fac3c059fc5bad4186ec9d69d0f
Reviewed-on: https://go-review.googlesource.com/c/go/+/401077
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
}
}
+ if strings.HasSuffix(testenv.Builder(), "-noopt") {
+ return // no inlining with the noopt builder
+ }
+
got := int(testing.AllocsPerRun(10, func() {
iter := v.MapRange()
for iter.Next() {
// The function is inlineable, so if the local usage does not escape
// the *MapIter, it can remain stack allocated.
want := 0
- if strings.HasSuffix(testenv.Builder(), "-noopt") {
- want = 1 // no inlining with the noopt builder
- }
if got != want {
t.Errorf("wanted %d alloc, got %d", want, got)
}