[HLSL][SPIRV] Add any intrinsic lowering (#88325)
[llvm-project.git] / libcxxabi / test / uncaught_exception.pass.cpp
blob9087059aeba548a280749c2a4849a9b3c55a3643
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: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}}
19 // XFAIL: stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(11|12|13|14)([.][0-9]+)?}}
21 #include <cxxabi.h>
22 #include <cassert>
24 // namespace __cxxabiv1 {
25 // extern bool __cxa_uncaught_exception () throw();
26 // }
28 struct A {
29 ~A() { assert( __cxxabiv1::__cxa_uncaught_exception()); }
32 int main () {
33 try { A a; throw 3; assert(false); }
34 catch (int) {}