Clang] Fix expansion of response files in -Wp after integrated-cc1 change
[llvm-project.git] / libcxxabi / test / uncaught_exceptions.pass.cpp
blobf4b2d36510020af840d59a88112f144e35382315
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 #include <cxxabi.h>
12 #include <cassert>
14 // namespace __cxxabiv1 {
15 // extern unsigned int __cxa_uncaught_exceptions() throw();
16 // }
18 struct A {
19 A(unsigned cnt) : data_(cnt) {}
20 ~A() { assert( data_ == __cxxabiv1::__cxa_uncaught_exceptions()); }
21 unsigned data_;
24 int main () {
25 try { A a(1); throw 3; assert(false); }
26 catch (int) {}