aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile
diff options
context:
space:
mode:
authorJorropo <jorropo.pgm@gmail.com>2025-11-26 09:49:50 +0100
committerGopher Robot <gobot@golang.org>2025-11-26 10:19:21 -0800
commit37ce4adcd45febab8b5da1fe5ce609f1f6673894 (patch)
treeacf89a5b2967eb0dd465b7809bee34b9c8e8b2b8 /src/cmd/compile
parent437d2362ce8ad3e10631aaf90cb4d8c8126d1bac (diff)
downloadgo-37ce4adcd45febab8b5da1fe5ce609f1f6673894.tar.xz
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>
Diffstat (limited to 'src/cmd/compile')
-rw-r--r--src/cmd/compile/internal/ssa/prove_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/prove_test.go b/src/cmd/compile/internal/ssa/prove_test.go
index 0044b60a16..6315049870 100644
--- a/src/cmd/compile/internal/ssa/prove_test.go
+++ b/src/cmd/compile/internal/ssa/prove_test.go
@@ -67,3 +67,10 @@ func TestLimitNegSigned(t *testing.T) {
func TestLimitNegUnsigned(t *testing.T) {
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 })
+}