1a3ca7dd0SBjorn Pettersson; RUN: opt < %s -passes=mem2reg -S 2cee313d2SEric Christopher; PR5023 3cee313d2SEric Christopher 4cee313d2SEric Christopherdeclare i32 @test1f() 5cee313d2SEric Christopher 6*9daaaad9SMatt Arsenaultdefine i32 @test1() personality ptr @__gxx_personality_v0 { 7cee313d2SEric Christopherentry: 8cee313d2SEric Christopher %whichFlag = alloca i32 9cee313d2SEric Christopher %A = invoke i32 @test1f() 10cee313d2SEric Christopher to label %invcont2 unwind label %lpad86 11cee313d2SEric Christopher 12cee313d2SEric Christopherinvcont2: 13*9daaaad9SMatt Arsenault store i32 %A, ptr %whichFlag 14cee313d2SEric Christopher br label %bb15 15cee313d2SEric Christopher 16cee313d2SEric Christopherbb15: 17*9daaaad9SMatt Arsenault %B = load i32, ptr %whichFlag 18cee313d2SEric Christopher ret i32 %B 19cee313d2SEric Christopher 20cee313d2SEric Christopherlpad86: 21*9daaaad9SMatt Arsenault %exn = landingpad {ptr, i32} 22cee313d2SEric Christopher cleanup 23cee313d2SEric Christopher br label %bb15 24cee313d2SEric Christopher 25cee313d2SEric Christopher} 26cee313d2SEric Christopher 27cee313d2SEric Christopherdeclare i32 @__gxx_personality_v0(...) 28cee313d2SEric Christopher 29cee313d2SEric Christopher 30cee313d2SEric Christopherdefine i32 @test2() { 31cee313d2SEric Christopherentry: 32cee313d2SEric Christopher %whichFlag = alloca i32 33cee313d2SEric Christopher br label %bb15 34cee313d2SEric Christopher 35cee313d2SEric Christopherbb15: 36*9daaaad9SMatt Arsenault %B = load i32, ptr %whichFlag 37cee313d2SEric Christopher ret i32 %B 38cee313d2SEric Christopher 39cee313d2SEric Christopherinvcont2: 40*9daaaad9SMatt Arsenault %C = load i32, ptr %whichFlag 41*9daaaad9SMatt Arsenault store i32 %C, ptr %whichFlag 42cee313d2SEric Christopher br label %bb15 43cee313d2SEric Christopher} 44cee313d2SEric Christopher 45