summaryrefslogtreecommitdiffstats
path: root/src/runtime/coverage/testdata/issue56006/repro.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/coverage/testdata/issue56006/repro.go')
-rw-r--r--src/runtime/coverage/testdata/issue56006/repro.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/runtime/coverage/testdata/issue56006/repro.go b/src/runtime/coverage/testdata/issue56006/repro.go
new file mode 100644
index 0000000..60a4925
--- /dev/null
+++ b/src/runtime/coverage/testdata/issue56006/repro.go
@@ -0,0 +1,26 @@
+package main
+
+//go:noinline
+func blah(x int) int {
+ if x != 0 {
+ return x + 42
+ }
+ return x - 42
+}
+
+func main() {
+ go infloop()
+ println(blah(1) + blah(0))
+}
+
+var G int
+
+func infloop() {
+ for {
+ G += blah(1)
+ G += blah(0)
+ if G > 10000 {
+ G = 0
+ }
+ }
+}