diff options
author | Rémy Oudompheng <oudomphe@phare.normalesup.org> | 2014-07-01 09:20:51 +0200 |
---|---|---|
committer | Rémy Oudompheng <oudomphe@phare.normalesup.org> | 2014-07-01 09:20:51 +0200 |
commit | 1ec56062ef6b256f8269e2ca8c5477e3a917331a (patch) | |
tree | 5798094c55f9f61686ffe6381e5257d86f3801af /test/torture.go | |
parent | 3cf83c182af504bcffb82f3fc78a0c8b0ffb3aaa (diff) | |
download | go-1ec56062ef6b256f8269e2ca8c5477e3a917331a.tar.gz go-1ec56062ef6b256f8269e2ca8c5477e3a917331a.zip |
cmd/8g: don't allocate a register early for cap(CHAN).
There is no reason to generate different code for cap and len.
Fixes #8025.
Fixes #8026.
LGTM=rsc
R=rsc, iant, khr
CC=golang-codereviews
https://golang.org/cl/93570044
Diffstat (limited to 'test/torture.go')
-rw-r--r-- | test/torture.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/torture.go b/test/torture.go index bbf6d347d9..197b481e66 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: + } +} |