Skip to content

Commit 4fb8ecd

Browse files
committed
[libunwind] Adjust the signal_frame test for Arm
Summary: This patch adjusts the signal_frame.pass.cpp to pass on Arm targets: * When Arm EHABI is used the unwinder does not use DWARF, hence the DWARF-specific check unw_is_signal_frame() must be disabled. * Certain C libraries don't include EH tables, so the unwinder must not try to step out of main(). The patch moves the test code out of main() into a separate function to avoid this. Reviewers: saugustine, ostannard, phosek, jfb, mclow.lists Reviewed By: saugustine Subscribers: dexonsmith, aprantl, kristof.beyls, christof, libcxx-commits, pbarrio, labrinea Tags: #libc Differential Revision: https://reviews.llvm.org/D70397
1 parent 26d36a1 commit 4fb8ecd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libunwind/test/signal_frame.pass.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@
1313
#include <stdlib.h>
1414
#include <libunwind.h>
1515

16-
int main(void) {
16+
void test() {
1717
asm(".cfi_signal_frame");
1818
unw_cursor_t cursor;
1919
unw_context_t uc;
2020
unw_getcontext(&uc);
2121
unw_init_local(&cursor, &uc);
2222
assert(unw_step(&cursor) > 0);
23+
#if !defined(_LIBUNWIND_ARM_EHABI)
2324
assert(unw_is_signal_frame(&cursor));
25+
#endif
26+
}
27+
28+
int main() {
29+
test();
2430
return 0;
2531
}

0 commit comments

Comments
 (0)