diff options
Diffstat (limited to 'src/pkg/runtime/race/race_test.go')
-rw-r--r-- | src/pkg/runtime/race/race_test.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/pkg/runtime/race/race_test.go b/src/pkg/runtime/race/race_test.go index 4776ae22d..7e0ee866a 100644 --- a/src/pkg/runtime/race/race_test.go +++ b/src/pkg/runtime/race/race_test.go @@ -44,7 +44,7 @@ func TestRace(t *testing.T) { if err != nil { t.Fatalf("Failed to run tests: %v\n%v", err, string(testOutput)) } - reader := bufio.NewReader(bytes.NewBuffer(testOutput)) + reader := bufio.NewReader(bytes.NewReader(testOutput)) funcName := "" var tsanLog []string @@ -155,3 +155,18 @@ func runTests() ([]byte, error) { cmd.Env = append(cmd.Env, `GORACE="suppress_equal_stacks=0 suppress_equal_addresses=0 exitcode=0"`) return cmd.CombinedOutput() } + +func TestIssue8102(t *testing.T) { + // If this compiles with -race, the test passes. + type S struct { + x interface{} + i int + } + c := make(chan int) + a := [2]*int{} + for ; ; c <- *a[S{}.i] { + if t != nil { + break + } + } +} |