llvm-project
28 строк · 908.0 Байт
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// REQUIRES: no-exceptions
10
11#include <cxxabi.h>
12#include <exception>
13#include <cassert>
14
15// namespace __cxxabiv1 {
16// void *__cxa_current_primary_exception() throw();
17// extern bool __cxa_uncaught_exception () throw();
18// extern unsigned int __cxa_uncaught_exceptions() throw();
19// }
20
21int main ()
22{
23// Trivially
24assert(nullptr == __cxxabiv1::__cxa_current_primary_exception());
25assert(!__cxxabiv1::__cxa_uncaught_exception());
26assert(0 == __cxxabiv1::__cxa_uncaught_exceptions());
27return 0;
28}
29