annotate libunwind/test/signal_frame.pass.cpp @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // -*- C++ -*-
anatofuz
parents:
diff changeset
2 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
3 //
anatofuz
parents:
diff changeset
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
5 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
7 //
anatofuz
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 // Ensure that functions marked as signal frames are reported as such.
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 // UNSUPPORTED: libunwind-arm-ehabi
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 #include <assert.h>
anatofuz
parents:
diff changeset
15 #include <stdlib.h>
anatofuz
parents:
diff changeset
16 #include <libunwind.h>
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 void test() {
anatofuz
parents:
diff changeset
19 asm(".cfi_signal_frame");
anatofuz
parents:
diff changeset
20 unw_cursor_t cursor;
anatofuz
parents:
diff changeset
21 unw_context_t uc;
anatofuz
parents:
diff changeset
22 unw_getcontext(&uc);
anatofuz
parents:
diff changeset
23 unw_init_local(&cursor, &uc);
anatofuz
parents:
diff changeset
24 assert(unw_step(&cursor) > 0);
anatofuz
parents:
diff changeset
25 assert(unw_is_signal_frame(&cursor));
anatofuz
parents:
diff changeset
26 }
anatofuz
parents:
diff changeset
27
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
28 int main(int, char**) {
150
anatofuz
parents:
diff changeset
29 test();
anatofuz
parents:
diff changeset
30 return 0;
anatofuz
parents:
diff changeset
31 }