[Support] Remove unused includes (NFC) (#116752)
[llvm-project.git] / libunwind / test / signal_frame.pass.cpp
blob004029cfe1e90b27d3672ca5403fa23f2b24c115
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 //===----------------------------------------------------------------------===//
10 // Ensure that functions marked as signal frames are reported as such.
12 // TODO: Investigate this failure on Apple
13 // XFAIL: target={{.+}}-apple-{{.+}}
15 // TODO: Figure out why this fails with Memory Sanitizer.
16 // XFAIL: msan
18 // UNSUPPORTED: libunwind-arm-ehabi
20 // The AIX assembler does not support CFI directives, which
21 // are necessary to run this test.
22 // UNSUPPORTED: target={{.*}}-aix{{.*}}
24 // Windows doesn't generally use CFI directives. However, i686
25 // mingw targets do use DWARF (where CFI directives are supported).
26 // UNSUPPORTED: target={{x86_64|arm.*|aarch64}}-{{.*}}-windows-{{.*}}
28 #undef NDEBUG
29 #include <assert.h>
30 #include <stdlib.h>
31 #include <libunwind.h>
33 void test() {
34 asm(".cfi_signal_frame");
35 unw_cursor_t cursor;
36 unw_context_t uc;
37 unw_getcontext(&uc);
38 unw_init_local(&cursor, &uc);
39 assert(unw_step(&cursor) > 0);
40 assert(unw_is_signal_frame(&cursor));
43 int main(int, char**) {
44 test();
45 return 0;