summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/microsoft-abi-eh-catch.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-04-22 23:39:15 +0000
committerReid Kleckner <reid@kleckner.net>2015-04-22 23:39:15 +0000
commite6800daa07ecc59750116a591dfd337372151034 (patch)
tree4fd9174c0339c364db4090b173c7d82ed683c143 /test/CodeGenCXX/microsoft-abi-eh-catch.cpp
parenta2bddf4b6aac8a5d1fc862c8b002ddb6a72f19df (diff)
[WinEH] Don't emit an exceptional cleanup for llvm.eh.endcatch
These extra endcatch markers aren't helping identify regions to outline, so let's get rid of them. LLVM outlines (more or less) from begincatch to endcatch. Any unwind edge from an enclosed invoke is a transition to a new exception handler, which has it's own outlining markers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235562 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/microsoft-abi-eh-catch.cpp')
-rw-r--r--test/CodeGenCXX/microsoft-abi-eh-catch.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/CodeGenCXX/microsoft-abi-eh-catch.cpp b/test/CodeGenCXX/microsoft-abi-eh-catch.cpp
index 292fad2e4d..d7268bf385 100644
--- a/test/CodeGenCXX/microsoft-abi-eh-catch.cpp
+++ b/test/CodeGenCXX/microsoft-abi-eh-catch.cpp
@@ -116,3 +116,39 @@ extern "C" void fn_with_exc_spec() throw(int) {
// WIN64-LABEL: define void @fn_with_exc_spec()
// WIN64: call void @might_throw()
// WIN64-NEXT: ret void
+
+extern "C" void catch_nested() {
+ try {
+ might_throw();
+ } catch (int) {
+ try {
+ might_throw();
+ } catch (int) {
+ might_throw();
+ }
+ }
+}
+
+// WIN64-LABEL: define void @catch_nested()
+// WIN64: invoke void @might_throw()
+// WIN64-NEXT: to label %[[cont1:[^ ]*]] unwind label %[[lp1:[^ ]*]]
+// WIN64: [[cont1]]
+//
+// WIN64: [[lp1]]
+// WIN64: landingpad { i8*, i32 }
+// WIN64: call void @llvm.eh.begincatch(i8* %{{.*}}, i8* null)
+// WIN64: invoke void @might_throw()
+// WIN64-NEXT: to label %[[cont2:[^ ]*]] unwind label %[[lp2:[^ ]*]]
+//
+// WIN64: [[cont2]]
+// WIN64-NEXT: br label %[[trycont:[^ ]*]]
+//
+// WIN64: [[lp2]]
+// WIN64: landingpad { i8*, i32 }
+// WIN64: call void @llvm.eh.begincatch(i8* %{{.*}}, i8* null)
+// WIN64-NEXT: call void @might_throw()
+// WIN64-NEXT: call void @llvm.eh.endcatch()
+// WIN64-NEXT: br label %[[trycont]]
+//
+// WIN64: [[trycont]]
+// WIN64: call void @llvm.eh.endcatch()