diff --git a/libunwind/src/UnwindRegistersRestore.S b/libunwind/src/UnwindRegistersRestore.S --- a/libunwind/src/UnwindRegistersRestore.S +++ b/libunwind/src/UnwindRegistersRestore.S @@ -1221,8 +1221,8 @@ ld.d $r\i, $a0, (8 * \i) .endr - ld.d $r4, $a0, (8 * 4) // restore $a0 last - ld.d $r1, $a0, (8 * 32) // load new pc into $ra + ld.d $ra, $a0, (8 * 32) // load new pc into $ra + ld.d $a0, $a0, (8 * 4) // restore $a0 last jr $ra diff --git a/libunwind/test/unw_resume.pass.cpp b/libunwind/test/unw_resume.pass.cpp --- a/libunwind/test/unw_resume.pass.cpp +++ b/libunwind/test/unw_resume.pass.cpp @@ -10,11 +10,6 @@ // Ensure that unw_resume() resumes execution at the stack frame identified by // cursor. -// FIXME: The return address register($ra/$r1) is restored with a destroyed base -// address register($a0/$r4) in the assembly file `UnwindRegistersRestore.S` on -// LoongArch. And we will fix this issue in the next commit. -// XFAIL: target={{loongarch64-.+}} - #include void test_unw_resume() {