From: Chris Lattner Date: Thu, 28 Aug 2003 20:33:46 +0000 (+0000) Subject: Add another testcase I found lying around. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=81f0dbdc23235db3f056e7170c7cc1da1b3103f8;p=oota-llvm.git Add another testcase I found lying around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8186 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/C++Frontend/EH/ctor_dtor_count.cpp b/test/C++Frontend/EH/ctor_dtor_count.cpp new file mode 100644 index 00000000000..a399c097818 --- /dev/null +++ b/test/C++Frontend/EH/ctor_dtor_count.cpp @@ -0,0 +1,23 @@ +#include + +static int c; + +struct A { + A() { ++c; } + A(const A&) { ++c; } + ~A() { --c; } +}; + +struct B { + A a; + B() { A a; throw 1; } +}; + +int main() { + try { + B b; + } catch (...) {} + if (!c) printf("All ok!\n"); + return c; +} +