aboutsummaryrefslogtreecommitdiff
path: root/test/index.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2012-11-08 15:43:28 -0800
committerIan Lance Taylor <iant@golang.org>2012-11-08 15:43:28 -0800
commit3e50372f1ff0229aa8c42cde8f5cd0b6357b605d (patch)
tree4207991c819a143c944994e1696bfc76b93473c3 /test/index.go
parent86b9e3e2b4aebd2fe80099e7c9ff8c0122fc77e4 (diff)
downloadgo-3e50372f1ff0229aa8c42cde8f5cd0b6357b605d.tar.gz
go-3e50372f1ff0229aa8c42cde8f5cd0b6357b605d.zip
test: change index.go to test size of int, not GOARCH == "amd64"
Fixes the test to work correctly on other platforms with 64-bit ints, like Alpha. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6822099
Diffstat (limited to 'test/index.go')
-rw-r--r--test/index.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/index.go b/test/index.go
index 528d7add47..daab45f7a1 100644
--- a/test/index.go
+++ b/test/index.go
@@ -13,7 +13,7 @@ import (
"bufio"
"fmt"
"os"
- "runtime"
+ "unsafe"
)
const prolog = `
@@ -214,9 +214,10 @@ func main() {
// the next pass from running.
// So run it as a separate check.
thisPass = 1
- } 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.
+ } else if a == "s" && n == "" && (i == "i64big" || i == "i64bigger") && unsafe.Sizeof(int(0)) > 4 {
+ // If int is 64 bits, these huge
+ // numbers do fit in an int, so they
+ // are not rejected at compile time.
thisPass = 0
} else {
thisPass = 2