Skip to content

Commit

Permalink
i#3544: RV64: Port test common.getretaddr to RV64
Browse files Browse the repository at this point in the history
Port assembly in common/getretaddr.c to riscv64 and implements
tailcall_with_retaddr().

Issue: #3544
  • Loading branch information
ziyao233 committed Dec 24, 2024
1 parent fa2eaa8 commit 2a51c8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions suite/tests/common/getretaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ GLOBAL_LABEL(FUNCNAME:)
ldr x30, [sp], #16
ret
# elif defined(RISCV64)
/* TODO i#3544: Port tests to RISC-V 64 */
ret
mv t0, ra
call next_instr
next_instr:
mv a0, ra
jr t0
# else
# error NYI
# endif
Expand All @@ -134,7 +137,7 @@ GLOBAL_LABEL(FUNCNAME:)
ldr x0, [x29, #8]
ret
# elif defined(RISCV64)
/* TODO i#3544: Port tests to RISC-V 64 */
ld a0, -8(fp)
ret
# else
# error NYI
Expand Down
5 changes: 3 additions & 2 deletions suite/tests/tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,9 @@ GLOBAL_LABEL(FUNCNAME:)
mov x0, x30 /* Replace first argument with return address. */
br x9 /* Tailcall to function pointer. */
#elif defined(RISCV64)
/* TODO i#3544: Port tests to RISC-V64 */
ret
mv t0, a0
mv a0, ra
jr t0
#else
# error NYI
#endif
Expand Down

0 comments on commit 2a51c8e

Please sign in to comment.