diff --git a/test/bounds.go b/test/bounds.go index 4a16f64d3d..50f7ad7419 100644 --- a/test/bounds.go +++ b/test/bounds.go @@ -247,10 +247,8 @@ func main() { use(s[ui/1e6]) use(a1[ui/1e6]) use(a1k[ui/1e6]) - use(a100k[ui/1e6]) // ERROR "index bounds check elided" use(p1[ui/1e6]) use(p1k[ui/1e6]) - use(p100k[ui/1e6]) // ERROR "index bounds check elided" use(s[i/1e7]) use(a1[i/1e7]) @@ -262,12 +260,7 @@ func main() { use(s[ui/1e7]) use(a1[ui/1e7]) - use(a1k[ui/1e7]) // ERROR "index bounds check elided" - use(a100k[ui/1e7]) // ERROR "index bounds check elided" use(p1[ui/1e7]) - use(p1k[ui/1e7]) // ERROR "index bounds check elided" - use(p100k[ui/1e7]) // ERROR "index bounds check elided" - } var sum int diff --git a/test/fixedbugs/bug273.go b/test/fixedbugs/bug273.go index b35b17d2ed..c5e73e945c 100644 --- a/test/fixedbugs/bug273.go +++ b/test/fixedbugs/bug273.go @@ -8,14 +8,14 @@ package main -import "unsafe" - var bug = false var minus1 = -1 var big int64 = 10 | 1<<32 -var g1 []int +type block [1<<19]byte + +var g1 []block func shouldfail(f func(), desc string) { defer func() { recover() }() @@ -28,55 +28,47 @@ func shouldfail(f func(), desc string) { } func badlen() { - g1 = make([]int, minus1) + g1 = make([]block, minus1) } func biglen() { - g1 = make([]int, big) + g1 = make([]block, big) } func badcap() { - g1 = make([]int, 10, minus1) + g1 = make([]block, 10, minus1) } func badcap1() { - g1 = make([]int, 10, 5) + g1 = make([]block, 10, 5) } func bigcap() { - g1 = make([]int, 10, big) + g1 = make([]block, 10, big) } -var g3 map[int]int +var g3 map[block]block func badmapcap() { - g3 = make(map[int]int, minus1) + g3 = make(map[block]block, minus1) } func bigmapcap() { - g3 = make(map[int]int, big) + g3 = make(map[block]block, big) } -var g4 chan int +type cblock [1<<16-1]byte + +var g4 chan cblock func badchancap() { - g4 = make(chan int, minus1) + g4 = make(chan cblock, minus1) } func bigchancap() { - g4 = make(chan int, big) + g4 = make(chan cblock, big) } -const addrBits = unsafe.Sizeof((*byte)(nil)) - -var g5 chan [1<<15]byte func overflowchan() { - if addrBits == 32 { - g5 = make(chan [1<<15]byte, 1<<20) - } else { - // cannot overflow on 64-bit, because - // int is 32 bits and max chan value size - // in the implementation is 64 kB. - panic(1) - } + g4 = make(chan cblock, 1<<30) } func main() { diff --git a/test/fixedbugs/bug385_64.go b/test/fixedbugs/bug385_64.go index 76afa9a335..8c7b9d5208 100644 --- a/test/fixedbugs/bug385_64.go +++ b/test/fixedbugs/bug385_64.go @@ -11,7 +11,7 @@ package main func main() { // ERROR "stack frame too large" - var arr [1000200030]int + var arr [1000200030]int32 arr_bkup := arr _ = arr_bkup }