]> Cypherpunks repositories - gostls13.git/commitdiff
test: tweak bug273.go to not have constant len < cap when calling make
authorIan Lance Taylor <iant@golang.org>
Wed, 5 Dec 2012 00:51:51 +0000 (16:51 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 5 Dec 2012 00:51:51 +0000 (16:51 -0800)
The current spec says that when calling make, if both len and
cap are constant, it is an error if len > cap.  The gc
compiler does not yet implement that, but when it does this
will need to change.  Changing it now for the benefit of
gccgo.

R=gri
CC=golang-dev
https://golang.org/cl/6867064

test/fixedbugs/bug273.go

index c5e73e945c916c859f38c8e389927a164adf7971..aabb912b91379afd18583352d389b018cb0460e2 100644 (file)
@@ -11,6 +11,7 @@ package main
 var bug = false
 
 var minus1 = -1
+var five = 5
 var big int64 = 10 | 1<<32
 
 type block [1<<19]byte
@@ -40,7 +41,7 @@ func badcap() {
 }
 
 func badcap1() {
-       g1 = make([]block, 10, 5)
+       g1 = make([]block, 10, five)
 }
 
 func bigcap() {