Home | History | Annotate | Download | only in LowerInvoke
      1 ; RUN: opt < %s -lowerinvoke -disable-output -enable-correct-eh-support
      2 
      3 
      4 define i32 @foo() {
      5 	invoke i32 @foo( )
      6 			to label %Ok unwind label %Crap		; <i32>:1 [#uses=0]
      7 Ok:		; preds = %0
      8 	invoke i32 @foo( )
      9 			to label %Ok2 unwind label %Crap		; <i32>:2 [#uses=0]
     10 Ok2:		; preds = %Ok
     11 	ret i32 2
     12 Crap:		; preds = %Ok, %0
     13 	ret i32 1
     14 }
     15 
     16 define i32 @bar(i32 %blah) {
     17 	br label %doit
     18 doit:		; preds = %0
     19         ;; Value live across an unwind edge.
     20 	%B2 = add i32 %blah, 1		; <i32> [#uses=1]
     21 	invoke i32 @foo( )
     22 			to label %Ok unwind label %Crap		; <i32>:1 [#uses=0]
     23 Ok:		; preds = %doit
     24 	invoke i32 @foo( )
     25 			to label %Ok2 unwind label %Crap		; <i32>:2 [#uses=0]
     26 Ok2:		; preds = %Ok
     27 	ret i32 2
     28 Crap:		; preds = %Ok, %doit
     29 	ret i32 %B2
     30 }
     31