Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libunwind] Make libunwind_get_registers test pass on morello/aarch64. #729

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions libunwind/test/libunwind_get_registers.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,36 @@ int main() {
: /* no outputs */ \
: [r14_value] "X"(expected_r14) /* inputs */ \
: "r14" /* clobbers */)
#elif defined(__aarch64__)
#ifdef __CHERI_PURE_CAPABILITY__
uintcap_t expected_c10 = 0x12345678;
uintcap_t expected_c11 = 0x87654321;
auto check_reg_values = [=](unw_context_t *context, unw_cursor_t *cursor) {
(void)context;
CHECK_REG(UNW_ARM64_C10, expected_c10);
CHECK_REG(UNW_ARM64_C11, expected_c11);
};
#define ASM_SETUP_CONTEXT() \
__asm__ volatile("mov c10, %0\n\t" \
"mov c11, %1" \
: \
: "r"(expected_c10), "r"(expected_c11) \
: "c10", "c11")
#else // __CHERI_PURE_CAPABILITY__
size_t expected_x10 = 0x12345678;
size_t expected_x11 = 0x87654321;
auto check_reg_values = [=](unw_context_t *context, unw_cursor_t *cursor) {
(void)context;
CHECK_REG(UNW_ARM64_X10, expected_x10);
CHECK_REG(UNW_ARM64_X11, expected_x11);
};
#define ASM_SETUP_CONTEXT() \
__asm__ volatile("mov x10, %0\n\t" \
"mov x11, %1" \
: \
: "r"(expected_x10), "r"(expected_x11) \
: "x10", "x11")
#endif // __CHERI_PURE_CAPABILITY__
#else
#warning "Test not implemented for this architecture"
auto check_reg_values = [](unw_context_t *context, unw_cursor_t *cursor) {
Expand Down
Loading