llvm-project
31 строка · 834.0 Байт
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
10// Ensure that unw_resume() resumes execution at the stack frame identified by
11// cursor.
12
13// TODO: Figure out why this fails with Memory Sanitizer.
14// XFAIL: msan
15
16#include <libunwind.h>
17
18__attribute__((noinline)) void test_unw_resume() {
19unw_context_t context;
20unw_cursor_t cursor;
21
22unw_getcontext(&context);
23unw_init_local(&cursor, &context);
24unw_step(&cursor);
25unw_resume(&cursor);
26}
27
28int main() {
29test_unw_resume();
30return 0;
31}
32