blob: 59e2c0b3108dfb9440e25db49d0f3f7913ce5811 [file] [log] [blame]
Chris Lattner850c9172009-09-21 22:39:35 +00001; RUN: opt < %s -mem2reg -S
2; PR5023
3
Chris Lattner794c15d2009-11-02 04:37:17 +00004declare i32 @test1f()
Chris Lattner850c9172009-09-21 22:39:35 +00005
Chris Lattner794c15d2009-11-02 04:37:17 +00006define i32 @test1() {
Chris Lattner850c9172009-09-21 22:39:35 +00007entry:
8 %whichFlag = alloca i32
Chris Lattner794c15d2009-11-02 04:37:17 +00009 %A = invoke i32 @test1f()
Chris Lattner850c9172009-09-21 22:39:35 +000010 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:
Bill Wendling93590312011-08-31 21:39:05 +000021 %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
22 cleanup
Chris Lattner850c9172009-09-21 22:39:35 +000023 br label %bb15
24
25}
26
Bill Wendling93590312011-08-31 21:39:05 +000027declare i32 @__gxx_personality_v0(...)
Chris Lattner794c15d2009-11-02 04:37:17 +000028
29
30define i32 @test2() {
31entry:
32 %whichFlag = alloca i32
33 br label %bb15
34
35bb15:
36 %B = load i32* %whichFlag
37 ret i32 %B
38
39invcont2:
40 %C = load i32* %whichFlag
41 store i32 %C, i32* %whichFlag
42 br label %bb15
43}
44