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 -passes=instcombine -disable-output
12 define i32 @foo() personality ptr @__gxx_personality_v0 {
14 br i1 true, label %cont, label %call
16 call: ; preds = %entry
17 %P = invoke ptr @test( )
18 to label %cont unwind label %N ; <ptr> [#uses=1]
20 cont: ; preds = %call, %entry
21 %P2 = phi ptr [ %P, %call ], [ null, %entry ] ; <ptr> [#uses=1]
22 %V = load i32, ptr %P2 ; <i32> [#uses=1]
26 %exn = landingpad {ptr, i32}
31 declare i32 @__gxx_personality_v0(...)