aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/race/testdata
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2015-06-24 19:25:51 +0200
committerRuss Cox <rsc@golang.org>2015-06-26 15:54:03 +0000
commitcd0a8ed48a4a71fb4fdb3d3b22f91d2335e4793a (patch)
tree88189741d2a49467569837f509e3e4deca78640f /src/runtime/race/testdata
parentf271f928d9f1beb892dc576d397f37a3fddd6c0b (diff)
downloadgo-cd0a8ed48a4a71fb4fdb3d3b22f91d2335e4793a.tar.xz
cmd/compile: add instrumentation of OKEY
Instrument operands of OKEY. Also instrument OSLICESTR. Previously it was not needed because of preceeding bounds checks (which were instrumented). But the preceeding bounds checks have disappeared. Change-Id: I3b0de213e23cbcf5b8ef800abeded5eeeb3f8287 Reviewed-on: https://go-review.googlesource.com/11417 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/race/testdata')
-rw-r--r--src/runtime/race/testdata/slice_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/runtime/race/testdata/slice_test.go b/src/runtime/race/testdata/slice_test.go
index 32ae878970..1ec52438ec 100644
--- a/src/runtime/race/testdata/slice_test.go
+++ b/src/runtime/race/testdata/slice_test.go
@@ -578,3 +578,15 @@ func TestRaceCompareString(t *testing.T) {
s1 = s2
<-c
}
+
+func TestRaceSlice3(t *testing.T) {
+ done := make(chan bool)
+ x := make([]int, 10)
+ i := 2
+ go func() {
+ i = 3
+ done <- true
+ }()
+ _ = x[:1:i]
+ <-done
+}