cmd/compile: add tests bruteforcing limit complement

Change-Id: I9d8bd78a06738a8a242b6965382e61568e93dea7
Reviewed-on: https://go-review.googlesource.com/c/go/+/724620
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
Jorropo 2025-11-26 09:49:50 +01:00 committed by Gopher Robot
parent 437d2362ce
commit 37ce4adcd4

View file

@ -67,3 +67,10 @@ func TestLimitNegSigned(t *testing.T) {
func TestLimitNegUnsigned(t *testing.T) { func TestLimitNegUnsigned(t *testing.T) {
testLimitUnaryOpUnsigned8(t, "neg", limit.neg, func(x uint8) uint8 { return -x }) testLimitUnaryOpUnsigned8(t, "neg", limit.neg, func(x uint8) uint8 { return -x })
} }
func TestLimitComSigned(t *testing.T) {
testLimitUnaryOpSigned8(t, "com", limit.com, func(x int8) int8 { return ^x })
}
func TestLimitComUnsigned(t *testing.T) {
testLimitUnaryOpUnsigned8(t, "com", limit.com, func(x uint8) uint8 { return ^x })
}