// errorcheck -0 -d=ssa/prove/debug=1
//go:build amd64
-// +build amd64
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
return n / int32(16) // ERROR "Proved Rsh32x64 shifts to zero"
}
+// Bounds check elimination
+
+func sliceBCE1(p []string, h uint) string {
+ if len(p) == 0 {
+ return ""
+ }
+
+ i := h & uint(len(p)-1)
+ return p[i] // ERROR "Proved IsInBounds$"
+}
+
+func sliceBCE2(p []string, h int) string {
+ if len(p) == 0 {
+ return ""
+ }
+ i := h & (len(p) - 1)
+ return p[i] // ERROR "Proved IsInBounds$"
+}
+
func and(p []byte) ([]byte, []byte) { // issue #52563
const blocksize = 16
fullBlocks := len(p) &^ (blocksize - 1)
return 0
}
+func issue45928(x int) {
+ combinedFrac := x / (x | (1 << 31)) // ERROR "Proved Neq64$"
+ useInt(combinedFrac)
+}
+
//go:noinline
func useInt(a int) {
}