[IR] Reformulate LLVM's EH funclet IR
[oota-llvm.git] / test / CodeGen / WinEH / wineh-statenumbering.ll
index 2d5f7ca0c0e18da140f678fa350c7167d9705f69..b7ec843aa399ae9c4cf1602a5bf2e3c02a49396e 100644 (file)
@@ -37,9 +37,10 @@ entry:
           to label %unreachable.for.entry unwind label %catch.dispatch
 
 catch.dispatch:                                   ; preds = %entry
-  %1 = catchpad [i8* null, i32 u0x40, i8* null] to label %catch unwind label %catchendblock
+  %cs1 = catchswitch within none [label %catch] unwind to caller
 
 catch:                                            ; preds = %catch.dispatch
+  %1 = catchpad within %cs1 [i8* null, i32 u0x40, i8* null]
   ; CHECK: catch:
   ; CHECK:   store i32 2
   ; CHECK:   invoke void @_CxxThrowException(
@@ -47,34 +48,22 @@ catch:                                            ; preds = %catch.dispatch
           to label %unreachable unwind label %catch.dispatch.1
 
 catch.dispatch.1:                                 ; preds = %catch
-  %2 = catchpad [i8* null, i32 u0x40, i8* null] to label %catch.3 unwind label %catchendblock.2
-
+  %cs2 = catchswitch within %1 [label %catch.3] unwind to caller
 catch.3:                                          ; preds = %catch.dispatch.1
+  %2 = catchpad within %cs2 [i8* null, i32 u0x40, i8* null]
   ; CHECK: catch.3:
   ; CHECK:   store i32 3
-  ; CHECK:   invoke void @g(i32 1)
-  invoke void @g(i32 1)
-          to label %invoke.cont unwind label %catchendblock.2
-
-invoke.cont:                                      ; preds = %catch.3
-  catchret %2 to label %try.cont
+  ; CHECK:   call void @g(i32 1)
+  call void @g(i32 1)
+  catchret from %2 to label %try.cont
 
-try.cont:                                         ; preds = %invoke.cont
+try.cont:                                         ; preds = %catch.3
   ; CHECK: try.cont:
   ; CHECK:   store i32 1
-  ; CHECK:   invoke void @g(i32 2)
-  invoke void @g(i32 2)
-          to label %invoke.cont.4 unwind label %catchendblock
-
-invoke.cont.4:                                    ; preds = %try.cont
+  ; CHECK:   call void @g(i32 2)
+  call void @g(i32 2)
   unreachable
 
-catchendblock.2:                                  ; preds = %catch.3, %catch.dispatch.1
-  catchendpad unwind label %catchendblock
-
-catchendblock:                                    ; preds = %catchendblock.2, %try.cont, %catch.dispatch
-  catchendpad unwind to caller
-
 unreachable:                                      ; preds = %catch
   unreachable