1; RUN: opt < %s -mem2reg -S 2; PR5023 3 4declare i32 @test1f() 5 6define i32 @test1() { 7entry: 8 %whichFlag = alloca i32 9 %A = invoke i32 @test1f() 10 to label %invcont2 unwind label %lpad86 11 12invcont2: 13 store i32 %A, i32* %whichFlag 14 br label %bb15 15 16bb15: 17 %B = load i32* %whichFlag 18 ret i32 %B 19 20lpad86: 21 br label %bb15 22 23} 24 25 26 27define i32 @test2() { 28entry: 29 %whichFlag = alloca i32 30 br label %bb15 31 32bb15: 33 %B = load i32* %whichFlag 34 ret i32 %B 35 36invcont2: 37 %C = load i32* %whichFlag 38 store i32 %C, i32* %whichFlag 39 br label %bb15 40} 41 42