]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/race: add test case for issue 4453
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 27 Nov 2012 17:59:08 +0000 (21:59 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 27 Nov 2012 17:59:08 +0000 (21:59 +0400)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6854103

src/pkg/runtime/race/testdata/mop_test.go

index da428c8a24e994e5f733c15a17341669508e4de7..fa92182fa26518acda7c9154a935a6f013ba8469 100644 (file)
@@ -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 {