summaryrefslogtreecommitdiffstats
path: root/test/fixedbugs/issue54159.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixedbugs/issue54159.go')
-rw-r--r--test/fixedbugs/issue54159.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/fixedbugs/issue54159.go b/test/fixedbugs/issue54159.go
new file mode 100644
index 0000000..8ef0e68
--- /dev/null
+++ b/test/fixedbugs/issue54159.go
@@ -0,0 +1,22 @@
+// 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
+
+func run() { // ERROR "cannot inline run: recursive"
+ 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"
+ run()
+}
+
+func g() { // ERROR "can inline g with cost .* as:.*"
+}
+
+func main() { // ERROR "can inline main with cost .* as:.*"
+ run()
+}