Mercurial > hg > CbC > CbC_llvm
view libcxxabi/test/uncaught_exceptions.pass.cpp @ 174:f935e5e0dbe7
merged
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 12:28:41 +0900 |
parents | 0572611fdcc8 |
children | 2e18cbf3894f |
line wrap: on
line source
//===------------------- uncaught_exceptions.pass.cpp ---------------------===// // // 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 // //===----------------------------------------------------------------------===// // UNSUPPORTED: no-exceptions #include <cxxabi.h> #include <cassert> // namespace __cxxabiv1 { // extern unsigned int __cxa_uncaught_exceptions() throw(); // } struct A { A(unsigned cnt) : data_(cnt) {} ~A() { assert( data_ == __cxxabiv1::__cxa_uncaught_exceptions()); } unsigned data_; }; int main () { try { A a(1); throw 3; assert(false); } catch (int) {} }