| //===----------------------------------------------------------------------===// |
| // 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: libcpp-no-exceptions |
| // XFAIL: libcpp-no-exceptions |
| // XFAIL: with_system_cxx_lib=macosx10.12 |
| // XFAIL: with_system_cxx_lib=macosx10.13 |
| // test uncaught_exceptions |
| Uncaught(int depth) : d_(depth) {} |
| ~Uncaught() { assert(std::uncaught_exceptions() == d_); } |
| Outer(int depth) : d_(depth) {} |
| assert(std::uncaught_exceptions() == d_); |
| assert(std::uncaught_exceptions() == 0); |
| assert(std::uncaught_exceptions() == 0); |
| assert(std::uncaught_exceptions() == 0); |
| assert(std::uncaught_exceptions() == 0); |