1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-exceptions
11 // std::uncaught_exceptions() gives the wrong answer in versions of
12 // the dylib that don't contain 3a92ecc. Previously, it only returned
14 // XFAIL: using-built-library-before-llvm-9
16 // test uncaught_exceptions
21 #include "test_macros.h"
24 Uncaught(int depth
) : d_(depth
) {}
25 ~Uncaught() { assert(std::uncaught_exceptions() == d_
); }
30 Outer(int depth
) : d_(depth
) {}
33 assert(std::uncaught_exceptions() == d_
);
42 int main(int, char**) {
43 assert(std::uncaught_exceptions() == 0);
48 assert(std::uncaught_exceptions() == 0);
55 assert(std::uncaught_exceptions() == 0);
58 assert(std::uncaught_exceptions() == 0);