Commit 3e50372f authored by Ian Lance Taylor's avatar Ian Lance Taylor

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
parent 86b9e3e2
...@@ -13,7 +13,7 @@ import ( ...@@ -13,7 +13,7 @@ import (
"bufio" "bufio"
"fmt" "fmt"
"os" "os"
"runtime" "unsafe"
) )
const prolog = ` const prolog = `
...@@ -214,9 +214,10 @@ func main() { ...@@ -214,9 +214,10 @@ func main() {
// the next pass from running. // the next pass from running.
// So run it as a separate check. // So run it as a separate check.
thisPass = 1 thisPass = 1
} else if a == "s" && n == "" && (i == "i64big" || i == "i64bigger") && runtime.GOARCH == "amd64" { } else if a == "s" && n == "" && (i == "i64big" || i == "i64bigger") && unsafe.Sizeof(int(0)) > 4 {
// On amd64, these huge numbers do fit in an int, so they are not // If int is 64 bits, these huge
// rejected at compile time. // numbers do fit in an int, so they
// are not rejected at compile time.
thisPass = 0 thisPass = 0
} else { } else {
thisPass = 2 thisPass = 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment