]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/bounds.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / bounds.go
index 34c444877baae490eed3f41b01b7de27d146bb55..aa1d51b6f9cc6e5290bd677ebddac497fee69b71 100644 (file)
@@ -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])