]> Cypherpunks repositories - gostls13.git/commitdiff
test: fix index.go to pass with recent index checks
authorIan Lance Taylor <iant@golang.org>
Tue, 6 Nov 2012 19:38:16 +0000 (11:38 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 6 Nov 2012 19:38:16 +0000 (11:38 -0800)
The compiler now gives an error for out of bounds constant
indexes for arrays, and for negative constant indexes for both
arrays and slices.

With this change the index.go test passes if CLs 6815085,
6815088, and 6812089 are committed.

R=golang-dev, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/6810085

test/index.go

index 122b2a5724ac9e4264eaaeab8a042a98e8bf4485..461c2ee4184f6165d3b52a1a145018f8aa4a7edb 100644 (file)
@@ -225,7 +225,7 @@ func main() {
                                // the next pass from running.
                                // So run it as a separate check.
                                thisPass = 1
-                       } else if i == "i64big" || i == "i64bigger" && runtime.GOARCH == "amd64" {
+                       } else if a == "s" && n == "" && (i == "i64big" || i == "i64bigger") && runtime.GOARCH == "amd64" {
                                // On amd64, these huge numbers do fit in an int, so they are not
                                // rejected at compile time.
                                thisPass = 0