llvm-project/libunwind/test/unw_resume.pass.cpp
Louis Dionne ca06c330fd
[libc++] Allow running the test suite with optimizations (#68753)
This patch adds a configuration of the libc++ test suite that enables
optimizations when building the tests. It also adds a new CI
configuration to exercise this on a regular basis. This is added in the
context of [1], which requires building with optimizations in order to
hit the bug.

[1]: https://github.com/llvm/llvm-project/issues/68552
2024-01-09 10:39:14 -05:00

32 lines
834 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 unw_resume() resumes execution at the stack frame identified by
// cursor.
// TODO: Figure out why this fails with Memory Sanitizer.
// XFAIL: msan
#include <libunwind.h>
__attribute__((noinline)) void test_unw_resume() {
unw_context_t context;
unw_cursor_t cursor;
unw_getcontext(&context);
unw_init_local(&cursor, &context);
unw_step(&cursor);
unw_resume(&cursor);
}
int main() {
test_unw_resume();
return 0;
}