Add another testcase I found lying around.
authorChris Lattner <sabre@nondot.org>
Thu, 28 Aug 2003 20:33:46 +0000 (20:33 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 28 Aug 2003 20:33:46 +0000 (20:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8186 91177308-0d34-0410-b5e6-96231b3b80d8

test/C++Frontend/EH/ctor_dtor_count.cpp [new file with mode: 0644]

diff --git a/test/C++Frontend/EH/ctor_dtor_count.cpp b/test/C++Frontend/EH/ctor_dtor_count.cpp
new file mode 100644 (file)
index 0000000..a399c09
--- /dev/null
@@ -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;
+}
+