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