[llvm-commits] CVS: llvm/test/Regression/C++Frontend/EH/ctor_dtor_count.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Aug 28 15:34:01 PDT 2003


Changes in directory llvm/test/Regression/C++Frontend/EH:

ctor_dtor_count.cpp added (r1.1)

---
Log message:

Add another testcase I found lying around.


---
Diffs of the changes:

Index: llvm/test/Regression/C++Frontend/EH/ctor_dtor_count.cpp
diff -c /dev/null llvm/test/Regression/C++Frontend/EH/ctor_dtor_count.cpp:1.1
*** /dev/null	Thu Aug 28 15:33:56 2003
--- llvm/test/Regression/C++Frontend/EH/ctor_dtor_count.cpp	Thu Aug 28 15:33:46 2003
***************
*** 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;
+ }
+ 





More information about the llvm-commits mailing list