In the libc++ test suite, we consistently declare main() functions with full parameters and explicitly return from the function. This helps code that compiles the tests with -ffreestanding, where main() is not a special function (with an implicit return and special mangling). This patch fixes a few stray declarations, including in libunwind and libc++abi.
32 lines
846 B
C++
32 lines
846 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(int, char **) {
|
|
test_unw_resume();
|
|
return 0;
|
|
}
|