Commit 58ce93b6 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime/race: add test case for issue 4453

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6854103
parent 94b3f6d7
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment