From e5dd32da11e703d1ff48731b7cb49c9e473aca2b Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 5 Oct 2010 20:48:15 +0000 Subject: 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. llvm-svn: 115668 --- clang/test/CodeGenCXX/goto.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 clang/test/CodeGenCXX/goto.cpp (limited to 'clang/test/CodeGenCXX/goto.cpp') diff --git a/clang/test/CodeGenCXX/goto.cpp b/clang/test/CodeGenCXX/goto.cpp new file mode 100644 index 00000000000..7ebb72f54a0 --- /dev/null +++ b/clang/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 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>(); +} +} -- cgit v1.2.3