signal_frame.pass.cpp 822 B

12345678910111213141516171819202122232425262728293031
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // Ensure that functions marked as signal frames are reported as such.
  10. // UNSUPPORTED: libunwind-arm-ehabi
  11. #include <assert.h>
  12. #include <stdlib.h>
  13. #include <libunwind.h>
  14. void test() {
  15. asm(".cfi_signal_frame");
  16. unw_cursor_t cursor;
  17. unw_context_t uc;
  18. unw_getcontext(&uc);
  19. unw_init_local(&cursor, &uc);
  20. assert(unw_step(&cursor) > 0);
  21. assert(unw_is_signal_frame(&cursor));
  22. }
  23. int main(int, char**) {
  24. test();
  25. return 0;
  26. }