[LLD][COFF] Emit tail merge pdata for delay load thunks on ARM64EC (#116810)
[llvm-project.git] / libcxxabi / test / uncaught_exception.pass.cpp
blobcace88a309d0b70e6769c6439c699b2ec101c985
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 // UNSUPPORTED: no-exceptions
11 // This tests that libc++abi still provides __cxa_uncaught_exception() for
12 // ABI compatibility, even though the Standard doesn't require it to.
14 // __cxa_uncaught_exception was not re-exported from libc++ previously. This leads
15 // to undefined symbols when linking against a libc++ that re-exports the symbols,
16 // but running against a libc++ that doesn't. Fortunately, usage of __cxa_uncaught_exception()
17 // in the wild seems to be close to non-existent.
18 // XFAIL: using-built-library-before-llvm-19
20 #include <cxxabi.h>
21 #include <cassert>
23 // namespace __cxxabiv1 {
24 // extern bool __cxa_uncaught_exception () throw();
25 // }
27 struct A {
28 ~A() { assert( __cxxabiv1::__cxa_uncaught_exception()); }
31 int main () {
32 try { A a; throw 3; assert(false); }
33 catch (int) {}