mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
this does result in a little bit more inlining, cmd/compile text is 0.5% larger, bent-benchmark text geomeans grow by only 0.02%. some of our tests make assumptions about inlining. Change-Id: I999d1798aca5dc64a1928bd434258a61e702951a Reviewed-on: https://go-review.googlesource.com/c/go/+/655157 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
25 lines
616 B
Go
25 lines
616 B
Go
// errorcheck -0 -m=2
|
|
|
|
// Copyright 2023 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
//go:noinline
|
|
func run() { // ERROR "cannot inline run: marked go:noinline"
|
|
f := func() { // ERROR "can inline run.func1 with cost .* as:.*" "func literal does not escape"
|
|
g() // ERROR "inlining call to g"
|
|
}
|
|
f() // ERROR "inlining call to run.func1" "inlining call to g"
|
|
_ = f
|
|
run()
|
|
}
|
|
|
|
func g() { // ERROR "can inline g with cost .* as:.*"
|
|
}
|
|
|
|
func main() { // ERROR "can inline main with cost .* as:.*"
|
|
run()
|
|
}
|