3 // Copyright 2018 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
10 func Foo(x int) int { // ERROR "can inline Foo with cost .* as: func\(int\) int { return x \* \(x \+ 1\) \* \(x \+ 2\) }$"
11 return x * (x + 1) * (x + 2)
14 func Bar(x int) int { // ERROR "can inline Bar with cost .* as: func\(int\) int { return x \* \(x \+ 1\) \* \(x \+ 2\) }$"
15 return x * (x + 1) * (x + 2)
20 //go:noinline Provide a clean, constant reason for not inlining main
21 func main() { // ERROR "cannot inline main: marked go:noinline$"
22 println("Foo(", x, ")=", Foo(x)) // ERROR "inlining call to Foo"
23 println("Bar(", x, ")=", Bar(x)) // ERROR "inlining call to Bar"