From: Dmitriy Vyukov Date: Tue, 27 Nov 2012 17:59:08 +0000 (+0400) Subject: runtime/race: add test case for issue 4453 X-Git-Tag: go1.1rc2~1767 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=58ce93b6bfe1e24539d621ef326876f1f6758cf8;p=gostls13.git runtime/race: add test case for issue 4453 R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6854103 --- diff --git a/src/pkg/runtime/race/testdata/mop_test.go b/src/pkg/runtime/race/testdata/mop_test.go index da428c8a24..fa92182fa2 100644 --- a/src/pkg/runtime/race/testdata/mop_test.go +++ b/src/pkg/runtime/race/testdata/mop_test.go @@ -1239,6 +1239,22 @@ func TestRaceSliceSlice2(t *testing.T) { <-c } +// http://golang.org/issue/4453 +func TestRaceFailingSliceStruct(t *testing.T) { + type X struct { + x, y int + } + c := make(chan bool, 1) + x := make([]X, 10) + go func() { + y := make([]X, 10) + copy(y, x) + c <- true + }() + x[1].y = 42 + <-c +} + func TestRaceStructInd(t *testing.T) { c := make(chan bool, 1) type Item struct {