summaryrefslogtreecommitdiff
path: root/test/torture.go
diff options
context:
space:
mode:
authorR?my Oudompheng <oudomphe@phare.normalesup.org>2014-07-01 09:20:51 +0200
committerR?my Oudompheng <oudomphe@phare.normalesup.org>2014-07-01 09:20:51 +0200
commitc2deeabade9ed68a67ff3428c954110e6cbe4a9a (patch)
treea381a99424d1f9b5b75df1c3949442f3f3807962 /test/torture.go
parent2f2707c79d7a458ed0a170b41033fd42b3732a7f (diff)
downloadgo-c2deeabade9ed68a67ff3428c954110e6cbe4a9a.tar.gz
cmd/8g: don't allocate a register early for cap(CHAN).
There is no reason to generate different code for cap and len. Fixes issue 8025. Fixes issue 8026. LGTM=rsc R=rsc, iant, khr CC=golang-codereviews https://codereview.appspot.com/93570044
Diffstat (limited to 'test/torture.go')
-rw-r--r--test/torture.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/torture.go b/test/torture.go
index bbf6d347d..197b481e6 100644
--- a/test/torture.go
+++ b/test/torture.go
@@ -337,3 +337,10 @@ func ChainDivConst(a int) int {
func ChainMulBytes(a, b, c byte) byte {
return a*(a*(a*(a*(a*(a*(a*(a*(a*b+c)+c)+c)+c)+c)+c)+c)+c) + c
}
+
+func ChainCap() {
+ select {
+ case <-make(chan int, cap(make(chan int, cap(make(chan int, cap(make(chan int, cap(make(chan int))))))))):
+ default:
+ }
+}