aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/arithmetic.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/codegen/arithmetic.go')
-rw-r--r--test/codegen/arithmetic.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/codegen/arithmetic.go b/test/codegen/arithmetic.go
index eb95416b6a..754c5c9bc9 100644
--- a/test/codegen/arithmetic.go
+++ b/test/codegen/arithmetic.go
@@ -575,3 +575,11 @@ func constantFold3(i, j int) int {
r := (5 * i) * (6 * j)
return r
}
+
+func addConst(i int64) (int64, int64) {
+ // riscv64:`ADDI`,-`LUI`
+ a := i + 3001
+ // riscv64:`LUI`,`ADDIW`
+ b := i + 5009
+ return a, b
+}