aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-05-31 09:35:54 -0400
committerRuss Cox <rsc@golang.org>2014-05-31 09:35:54 -0400
commite56dc9966504405ecdad49f54edb45859ab3fa91 (patch)
treed9437d0f6b0e854d4e442cad36956eec9ab916be /src/pkg/runtime
parent19c8f67e25dc25abdca34b1ebbfa6ed8439a7071 (diff)
downloadgo-e56dc9966504405ecdad49f54edb45859ab3fa91.tar.xz
cmd/gc: fix handling of for post-condition in -race mode
Fixes #8102. LGTM=bradfitz, dvyukov R=golang-codereviews, bradfitz, dvyukov CC=golang-codereviews https://golang.org/cl/100870046
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/race/race_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pkg/runtime/race/race_test.go b/src/pkg/runtime/race/race_test.go
index 88ef89d82a..7e0ee866a6 100644
--- a/src/pkg/runtime/race/race_test.go
+++ b/src/pkg/runtime/race/race_test.go
@@ -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
+ }
+ }
+}