summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/2003-11-29-DuplicatedCleanupTest.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-08-20 00:17:18 +0000
committerEric Christopher <echristo@apple.com>2011-08-20 00:17:18 +0000
commitaeac10e7b074d87522ccc5fad919417092971c57 (patch)
tree9c6cef28c28d51daa3a55aef4ff73a9bc5c3e114 /test/CodeGenCXX/2003-11-29-DuplicatedCleanupTest.cpp
parent2368b6af4a5f0c07c7b77f8900a956dce75bbf84 (diff)
Migrate, FileCheckize and update:
2003-11-02-WeakLinkage.cpp 2003-11-18-PtrMemConstantInitializer.cpp 2003-11-25-ReturningOpaqueByValue.cpp 2003-11-27-MultipleInheritanceThunk.cpp 2003-11-29-DuplicatedCleanupTest.cpp 2003-12-08-ArrayOfPtrToMemberFunc.cpp 2004-01-11-DynamicInitializedConstant.cpp from llvm/test/FrontendC++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138162 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/2003-11-29-DuplicatedCleanupTest.cpp')
-rw-r--r--test/CodeGenCXX/2003-11-29-DuplicatedCleanupTest.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/CodeGenCXX/2003-11-29-DuplicatedCleanupTest.cpp b/test/CodeGenCXX/2003-11-29-DuplicatedCleanupTest.cpp
new file mode 100644
index 0000000000..45325bc65c
--- /dev/null
+++ b/test/CodeGenCXX/2003-11-29-DuplicatedCleanupTest.cpp
@@ -0,0 +1,41 @@
+// RUN: %clang_cc1 -emit-llvm %s -o -
+
+
+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; }
+}
+}