aboutsummaryrefslogtreecommitdiff
path: root/test/live2.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-11-05 14:42:54 -0500
committerRuss Cox <rsc@golang.org>2014-11-05 14:42:54 -0500
commit75d3f62b3c9dc21a2c32a74f1d19b67b965e410b (patch)
tree18a151b5de6b7d930343f11dbf82ff512dae3022 /test/live2.go
parent91658f934d6dc4672fa1e511e37d76b4d5b6c134 (diff)
downloadgo-75d3f62b3c9dc21a2c32a74f1d19b67b965e410b.tar.gz
go-75d3f62b3c9dc21a2c32a74f1d19b67b965e410b.zip
[dev.garbage] cmd/gc, runtime: add locks around print statements
Now each C printf, Go print, or Go println is guaranteed not to be interleaved with other calls of those functions. This should help when debugging concurrent failures. LGTM=rlh R=rlh CC=golang-codereviews https://golang.org/cl/169120043
Diffstat (limited to 'test/live2.go')
-rw-r--r--test/live2.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/live2.go b/test/live2.go
index ef6ad994cc..1bd0af2cc1 100644
--- a/test/live2.go
+++ b/test/live2.go
@@ -12,6 +12,8 @@ package main
// issue 8142: lost 'addrtaken' bit on inlined variables.
// no inlining in this test, so just checking that non-inlined works.
+func printnl()
+
type T40 struct {
m map[int]int
}
@@ -24,7 +26,7 @@ func newT40() *T40 {
func bad40() {
t := newT40() // ERROR "live at call to makemap: ret"
- println() // ERROR "live at call to printnl: ret"
+ printnl() // ERROR "live at call to printnl: ret"
_ = t
}
@@ -32,6 +34,6 @@ func good40() {
ret := T40{}
ret.m = make(map[int]int) // ERROR "live at call to makemap: ret"
t := &ret
- println() // ERROR "live at call to printnl: ret"
+ printnl() // ERROR "live at call to printnl: ret"
_ = t
}