Clang] Fix expansion of response files in -Wp after integrated-cc1 change
[llvm-project.git] / libcxxabi / test / uncaught_exception.pass.cpp
blob626f4cba11545ac1ba7e97d1f4dc208055bb69e2
1 //===------------------- uncaught_exceptions.pass.cpp ---------------------===//
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: libcxxabi-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 #include <cxxabi.h>
15 #include <cassert>
17 // namespace __cxxabiv1 {
18 // extern bool __cxa_uncaught_exception () throw();
19 // }
21 struct A {
22 ~A() { assert( __cxxabiv1::__cxa_uncaught_exception()); }
25 int main () {
26 try { A a; throw 3; assert(false); }
27 catch (int) {}