diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-08-28 20:33:46 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-08-28 20:33:46 +0000 |
| commit | 0ca03c01399de40266404cef16713afec0d229eb (patch) | |
| tree | 336a7aa2a3e73de9084ff4249276253afcfa41a3 /llvm/test/Regression/C++Frontend | |
| parent | a9c1cd238a8384afc6379831939d70286931fabc (diff) | |
| download | bcm5719-llvm-0ca03c01399de40266404cef16713afec0d229eb.tar.gz bcm5719-llvm-0ca03c01399de40266404cef16713afec0d229eb.zip | |
Add another testcase I found lying around.
llvm-svn: 8186
Diffstat (limited to 'llvm/test/Regression/C++Frontend')
| -rw-r--r-- | llvm/test/Regression/C++Frontend/EH/ctor_dtor_count.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/Regression/C++Frontend/EH/ctor_dtor_count.cpp b/llvm/test/Regression/C++Frontend/EH/ctor_dtor_count.cpp new file mode 100644 index 00000000000..a399c097818 --- /dev/null +++ b/llvm/test/Regression/C++Frontend/EH/ctor_dtor_count.cpp @@ -0,0 +1,23 @@ +#include <stdio.h> + +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; +} + |

