llvm-project/libcxxabi/test/noexception4.pass.cpp
Louis Dionne eb8650a757 [runtimes][NFC] Remove filenames at the top of the license notice
We've stopped doing it in libc++ for a while now because these names
would end up rotting as we move things around and copy/paste stuff.
This cleans up all the existing files so as to stop the spreading
as people copy-paste headers around.
2021-11-17 16:30:52 -05:00

29 lines
908 B
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
//
//===----------------------------------------------------------------------===//
// REQUIRES: no-exceptions
#include <cxxabi.h>
#include <exception>
#include <cassert>
// namespace __cxxabiv1 {
// void *__cxa_current_primary_exception() throw();
// extern bool __cxa_uncaught_exception () throw();
// extern unsigned int __cxa_uncaught_exceptions() throw();
// }
int main ()
{
// Trivially
assert(nullptr == __cxxabiv1::__cxa_current_primary_exception());
assert(!__cxxabiv1::__cxa_uncaught_exception());
assert(0 == __cxxabiv1::__cxa_uncaught_exceptions());
return 0;
}