1 ; Test for a problem afflicting several C++ programs in the testsuite. The
2 ; instcombine pass is trying to get rid of the cast in the invoke instruction,
3 ; inserting a cast of the return value after the PHI instruction, but which is
4 ; used by the PHI instruction. This is bad: because of the semantics of the
5 ; invoke instruction, we really cannot perform this transformation at all at
6 ; least without splitting the critical edge.
8 ; RUN: opt < %s -instcombine -disable-output
12 define i32 @foo() personality i32 (...)* @__gxx_personality_v0 {
14 br i1 true, label %cont, label %call
16 call: ; preds = %entry
17 %P = invoke i32* bitcast (i8* ()* @test to i32* ()*)( )
18 to label %cont unwind label %N ; <i32*> [#uses=1]
20 cont: ; preds = %call, %entry
21 %P2 = phi i32* [ %P, %call ], [ null, %entry ] ; <i32*> [#uses=1]
22 %V = load i32, i32* %P2 ; <i32> [#uses=1]
26 %exn = landingpad {i8*, i32}
31 declare i32 @__gxx_personality_v0(...)