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. 7; 8; RUN: opt < %s -passes=instcombine -disable-output 9 10declare ptr @test() 11 12define i32 @foo() personality ptr @__gxx_personality_v0 { 13entry: 14 br i1 true, label %cont, label %call 15 16call: ; preds = %entry 17 %P = invoke ptr @test( ) 18 to label %cont unwind label %N ; <ptr> [#uses=1] 19 20cont: ; preds = %call, %entry 21 %P2 = phi ptr [ %P, %call ], [ null, %entry ] ; <ptr> [#uses=1] 22 %V = load i32, ptr %P2 ; <i32> [#uses=1] 23 ret i32 %V 24 25N: ; preds = %call 26 %exn = landingpad {ptr, i32} 27 cleanup 28 ret i32 0 29} 30 31declare i32 @__gxx_personality_v0(...) 32