[llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-11-29-DuplicatedCleanupTest.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Nov 29 03:12:15 PST 2003


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

2003-11-29-DuplicatedCleanupTest.cpp added (r1.1)

---
Log message:

Testcase for duplicated cleanup work (PR11).  Note that this testcase is not actually
tested automatically, so it is practically useless.  However, it seemed silly to throw
away my testcase, so here it is.


---
Diffs of the changes:  (+39 -0)

Index: llvm/test/Regression/C++Frontend/2003-11-29-DuplicatedCleanupTest.cpp
diff -c /dev/null llvm/test/Regression/C++Frontend/2003-11-29-DuplicatedCleanupTest.cpp:1.1
*** /dev/null	Sat Nov 29 03:11:01 2003
--- llvm/test/Regression/C++Frontend/2003-11-29-DuplicatedCleanupTest.cpp	Sat Nov 29 03:10:50 2003
***************
*** 0 ****
--- 1,39 ----
+ 
+ void doesntThrow() throw();
+ struct F {
+   ~F() { doesntThrow(); }
+ };
+ 
+ void atest() {
+   F A;
+ lab:
+   F B;
+   goto lab;
+ }
+ 
+ void test(int val) {
+ label: {
+    F A;
+    F B;
+    if (val == 0) goto label;
+    if (val == 1) goto label;
+ }
+ }
+ 
+ void test3(int val) {
+ label: {
+    F A;
+    F B;
+    if (val == 0) { doesntThrow(); goto label; }
+    if (val == 1) { doesntThrow(); goto label; }
+ }
+ }
+ 
+ void test4(int val) {
+ label: {
+    F A;
+    F B;
+    if (val == 0) { F C; goto label; }
+    if (val == 1) { F D; goto label; }
+ }
+ }





More information about the llvm-commits mailing list