Commit 5bb7bf08 authored by Ian Lance Taylor's avatar Ian Lance Taylor

Fix expected string.

I got it wrong because gccgo was incorrectly failing to clear
the value when a nonblocking receive did not receive
anything.

R=rsc
CC=golang-dev
https://golang.org/cl/194161
parent a91e524b
...@@ -67,20 +67,26 @@ func main() { ...@@ -67,20 +67,26 @@ func main() {
a[i] = ' ' a[i] = ' '
} }
// 0 1 2 3 4 5
*f(), *f(), *f() = gbyte(), gbyte(), gbyte() *f(), *f(), *f() = gbyte(), gbyte(), gbyte()
// 6 7 8
*f(), *f() = x() *f(), *f() = x()
m := make(map[byte]byte) m := make(map[byte]byte)
m[10] = 'A' m[10] = 'A'
var p1, p2 bool var p1, p2 bool
// 9 10
*f(), p1 = m[gint()] *f(), p1 = m[gint()]
// 11 12
*f(), p2 = m[gint()] *f(), p2 = m[gint()]
a[11] += '0'
if !p1 || p2 { if !p1 || p2 {
panicln("bad map check", i, p1, p2) panicln("bad map check", i, p1, p2)
} }
m[13] = 'B' m[13] = 'B'
// 13 14
m[gint()] = gbyte(), false m[gint()] = gbyte(), false
if _, present := m[13]; present { if _, present := m[13]; present {
panicln("bad map removal") panicln("bad map removal")
...@@ -88,8 +94,11 @@ func main() { ...@@ -88,8 +94,11 @@ func main() {
c := make(chan byte, 1) c := make(chan byte, 1)
c <- 'C' c <- 'C'
// 15 16
*f(), p1 = <-e1(c, 16) *f(), p1 = <-e1(c, 16)
// 17 18
*f(), p2 = <-e1(c, 18) *f(), p2 = <-e1(c, 18)
a[17] += '0'
if !p1 || p2 { if !p1 || p2 {
panicln("bad chan check", i, p1, p2) panicln("bad chan check", i, p1, p2)
} }
...@@ -97,14 +106,16 @@ func main() { ...@@ -97,14 +106,16 @@ func main() {
s1 := S1{'D'} s1 := S1{'D'}
s2 := S2{'E'} s2 := S2{'E'}
var iv I var iv I
// 19 20
*e3(&iv, 19), p1 = e2(s1, 20).(I) *e3(&iv, 19), p1 = e2(s1, 20).(I)
// 21 22
*e3(&iv, 21), p2 = e2(s2, 22).(I) *e3(&iv, 21), p2 = e2(s2, 22).(I)
if !p1 || p2 { if !p1 || p2 {
panicln("bad interface check", i, p1, p2) panicln("bad interface check", i, p1, p2)
} }
s := string(a[0:i]) s := string(a[0:i])
if s != "def ii A C " { if s != "def ii A 0 C 0 " {
panicln("bad array results:", s) panicln("bad array results:", s)
} }
} }
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