diff options
author | Cherry Zhang <cherryyz@google.com> | 2020-10-28 09:12:20 -0400 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2020-10-28 09:12:20 -0400 |
commit | a16e30d162c1c7408db7821e7b9513cefa09c6ca (patch) | |
tree | af752ba9ba44c547df39bb0af9bff79f610ba9d5 /test/bounds.go | |
parent | 91e4d2d57bc341dd82c98247117114c851380aef (diff) | |
parent | cf6cfba4d5358404dd890f6025e573a4b2156543 (diff) | |
download | go-git-dev.link.tar.gz |
[dev.link] all: merge branch 'master' into dev.linkdev.link
Clean merge.
Change-Id: Ia7b2808bc649790198d34c226a61d9e569084dc5
Diffstat (limited to 'test/bounds.go')
-rw-r--r-- | test/bounds.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/bounds.go b/test/bounds.go index 34c444877b..aa1d51b6f9 100644 --- a/test/bounds.go +++ b/test/bounds.go @@ -201,6 +201,20 @@ func main() { use(p1k[ui&1000]) use(p100k[ui&1000]) // ERROR "index bounds check elided" + use(a1[i&^-1]) // ERROR "index bounds check elided" + use(a1[i&^0]) + use(a1[i&^-2]) + use(a1[i&^1]) + use(a1k[i&^-1]) // ERROR "index bounds check elided" + use(a1k[i&^0]) + use(a1k[i&^-2]) // ERROR "index bounds check elided" + use(a1k[i&^1]) + use(a1k[i8&^0]) + use(a1k[i8&^-128]) // ERROR "index bounds check elided" + use(a1k[ui8&^1]) // ERROR "index bounds check elided" + use(a1k[ui16&^0xf000]) + use(a1k[ui16&^0xff00]) // ERROR "index bounds check elided" + // Right shift cuts the effective number of bits in the index, // but only for unsigned (signed stays negative). use(s[i32>>22]) |