aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorMeng Zhuo <mengzhuo@iscas.ac.cn>2025-11-13 16:13:31 +0800
committerMeng Zhuo <mengzhuo@iscas.ac.cn>2025-12-05 17:31:30 -0800
commit0d0d5c9a827bac4da9cf20da351791d217e84ebb (patch)
treee35a62f2c874b7f5cc9040527b6946c53fadcc1d /test/codegen
parent2e509e61eff60aa0eced53fbdea4da1bff9ef150 (diff)
downloadgo-0d0d5c9a827bac4da9cf20da351791d217e84ebb.tar.xz
test/codegen: test negation with add/sub on riscv64
Change-Id: Ic0eca86d3c93707ebd7c716e774ebda55af4f196 Reviewed-on: https://go-review.googlesource.com/c/go/+/703755 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Julian Zhu <jz531210@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Joel Sing <joel@sing.id.au>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/arithmetic.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/codegen/arithmetic.go b/test/codegen/arithmetic.go
index 7cc6cf77e1..93e4aaed03 100644
--- a/test/codegen/arithmetic.go
+++ b/test/codegen/arithmetic.go
@@ -172,20 +172,26 @@ func SubAddSimplify2(a, b, c int) (int, int, int, int, int, int) {
// mips:"SUB" -"ADD"
// mips64:"SUBV" -"ADDV"
// loong64:"SUBV" -"ADDV"
+ // riscv64:-"ADD"
r := (a + b) - (a + c)
// amd64:-"ADDQ"
+ // riscv64:-"ADD"
r1 := (a + b) - (c + a)
// amd64:-"ADDQ"
+ // riscv64:-"ADD"
r2 := (b + a) - (a + c)
// amd64:-"ADDQ"
+ // riscv64:-"ADD"
r3 := (b + a) - (c + a)
// amd64:-"SUBQ"
// arm64:-"SUB"
// mips:"ADD" -"SUB"
// mips64:"ADDV" -"SUBV"
// loong64:"ADDV" -"SUBV"
+ // riscv64:-"SUB"
r4 := (a - c) + (c + b)
// amd64:-"SUBQ"
+ // riscv64:-"SUB"
r5 := (a - c) + (b + c)
return r, r1, r2, r3, r4, r5
}