mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 15:36:05 +00:00

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
32 lines
816 B
C++
32 lines
816 B
C++
// -*- C++ -*-
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Ensure that functions marked as signal frames are reported as such.
|
|
|
|
#include <assert.h>
|
|
#include <stdlib.h>
|
|
#include <libunwind.h>
|
|
|
|
void test() {
|
|
asm(".cfi_signal_frame");
|
|
unw_cursor_t cursor;
|
|
unw_context_t uc;
|
|
unw_getcontext(&uc);
|
|
unw_init_local(&cursor, &uc);
|
|
assert(unw_step(&cursor) > 0);
|
|
#if !defined(_LIBUNWIND_ARM_EHABI)
|
|
assert(unw_is_signal_frame(&cursor));
|
|
#endif
|
|
}
|
|
|
|
int main() {
|
|
test();
|
|
return 0;
|
|
}
|