1; RUN: opt < %s -lowerinvoke -disable-output -enable-correct-eh-support
2
3
4define i32 @foo() {
5	invoke i32 @foo( )
6			to label %Ok unwind label %Crap		; <i32>:1 [#uses=0]
7Ok:		; preds = %0
8	invoke i32 @foo( )
9			to label %Ok2 unwind label %Crap		; <i32>:2 [#uses=0]
10Ok2:		; preds = %Ok
11	ret i32 2
12Crap:		; preds = %Ok, %0
13	ret i32 1
14}
15
16define i32 @bar(i32 %blah) {
17	br label %doit
18doit:		; 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]
23Ok:		; preds = %doit
24	invoke i32 @foo( )
25			to label %Ok2 unwind label %Crap		; <i32>:2 [#uses=0]
26Ok2:		; preds = %Ok
27	ret i32 2
28Crap:		; preds = %Ok, %doit
29	ret i32 %B2
30}
31