Teach PopCleanupBlock to correctly handle the possibility of branching through
a EH-only cleanup as part of a fallthrough branch-through. That this happens
for this test case is actually a separate bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115668 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/goto.cpp b/test/CodeGenCXX/goto.cpp
new file mode 100644
index 0000000..7ebb72f
--- /dev/null
+++ b/test/CodeGenCXX/goto.cpp
@@ -0,0 +1,29 @@
+// RUN: %clang-cc1 %s -fexceptions
+
+// Reduced from a crash on boost::interprocess's node_allocator_test.cpp.
+namespace test0 {
+ struct A { A(); ~A(); };
+ struct V { V(const A &a = A()); ~V(); };
+
+ template<int X> int vector_test()
+ {
+ A process_name;
+ try {
+ A segment;
+
+ V *stdvector = new V();
+
+ int x = 5, y = 7;
+ if(x == y) return 1;
+ }
+ catch(int ex){
+ return 1;
+ }
+ return 0;
+}
+
+int main ()
+{
+ return vector_test<0>();
+}
+}