[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / libcxxabi / test / noexception4.pass.cpp
blob0ae015de54a0410d994ecff65087b37dac5c34e0
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 //===----------------------------------------------------------------------===//
9 // REQUIRES: no-exceptions
11 #include <cxxabi.h>
12 #include <exception>
13 #include <cassert>
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 // }
21 int main ()
23 // Trivially
24 assert(nullptr == __cxxabiv1::__cxa_current_primary_exception());
25 assert(!__cxxabiv1::__cxa_uncaught_exception());
26 assert(0 == __cxxabiv1::__cxa_uncaught_exceptions());
27 return 0;