; RUN: opt < %s -passes=indvars -disable-output ; ModuleID = '2004-04-05-InvokeCastCrash.ll' %struct.__false_type = type { i8 } %"struct.__gnu_cxx::_Hashtable_node" = type { ptr, ptr } %"struct.__gnu_cxx::_Hashtable_node >" = type { ptr, %"struct.std::pair" } %"struct.__gnu_cxx::hash_map,std::equal_to,std::allocator >" = type { %"struct.__gnu_cxx::hashtable,const llvm::Value*,__gnu_cxx::hash,std::_Select1st >,std::equal_to,std::allocator >" } %"struct.__gnu_cxx::hash_set,std::equal_to,std::allocator >" = type { %"struct.__gnu_cxx::hashtable,std::_Identity,std::equal_to,std::allocator >" } %"struct.__gnu_cxx::hashtable,std::_Identity,std::equal_to,std::allocator >" = type { %struct.__false_type, %struct.__false_type, %struct.__false_type, %struct.__false_type, %"struct.std::vector<__gnu_cxx::_Hashtable_nodeptr,std::allocator >", i32 } %"struct.__gnu_cxx::hashtable,const llvm::Value*,__gnu_cxx::hash,std::_Select1st >,std::equal_to,std::allocator >" = type { %struct.__false_type, %struct.__false_type, %struct.__false_type, %struct.__false_type, %"struct.std::vector<__gnu_cxx::_Hashtable_node >*,std::allocator >", i32 } %"struct.llvm::AbstractTypeUser" = type { ptr } %"struct.llvm::Annotable" = type { ptr, ptr } %"struct.llvm::Annotation" = type { ptr, %"struct.llvm::AnnotationID", ptr } %"struct.llvm::AnnotationID" = type { i32 } %"struct.llvm::Argument" = type { %"struct.llvm::Value", ptr, ptr, ptr } %"struct.llvm::BasicBlock" = type { %"struct.llvm::Value", %"struct.llvm::iplist >", ptr, ptr } %"struct.llvm::Constant" = type opaque %"struct.llvm::DerivedType" = type { %"struct.llvm::Type", %"struct.llvm::AbstractTypeUser", %"struct.std::vector >" } %"struct.llvm::Function" = type { %"struct.llvm::GlobalValue", %"struct.llvm::Annotable", %"struct.llvm::iplist >", %"struct.llvm::iplist >", ptr, ptr, ptr } %"struct.llvm::FunctionPass" = type { %"struct.llvm::Pass" } %"struct.llvm::FunctionType" = type { %"struct.llvm::DerivedType", i1 } %"struct.llvm::GlobalValue" = type { %"struct.llvm::User", i32, ptr } %"struct.llvm::Instruction" = type { %"struct.llvm::User", %"struct.llvm::Annotable", ptr, ptr, ptr, i32 } %"struct.llvm::IntrinsicLowering" = type opaque %"struct.llvm::MachineBasicBlock" = type { %"struct.llvm::ilist", ptr, ptr, ptr } %"struct.llvm::MachineConstantPool" = type opaque %"struct.llvm::MachineFrameInfo" = type opaque %"struct.llvm::MachineFunction" = type { %"struct.llvm::Annotation", ptr, ptr, %"struct.llvm::iplist >", ptr, ptr, ptr, ptr } %"struct.llvm::MachineFunctionInfo" = type { %"struct.__gnu_cxx::hash_set,std::equal_to,std::allocator >", %"struct.__gnu_cxx::hash_map,std::equal_to,std::allocator >", i32, i32, i32, i32, i32, i32, i32, i1, i1, i1, ptr } %"struct.llvm::MachineFunctionPass" = type { %"struct.llvm::FunctionPass" } %"struct.llvm::MachineInstr" = type { i16, i8, %"struct.std::vector >", ptr, ptr, ptr } %"struct.llvm::MachineInstrBuilder" = type { ptr } %"struct.llvm::MachineOperand" = type { %"union.llvm::MachineOperand::._65", i32, i32 } %"struct.llvm::Module" = type opaque %"struct.llvm::PATypeHandle" = type { ptr, ptr } %"struct.llvm::PATypeHolder" = type { ptr } %"struct.llvm::Pass" = type { ptr, ptr, ptr, %"struct.std::vector,std::allocator > >" } %"struct.llvm::PassInfo" = type { ptr, ptr, ptr, i8, %"struct.std::vector >", ptr, ptr } %"struct.llvm::SSARegMap" = type opaque %"struct.llvm::SymbolTable" = type opaque %"struct.llvm::SymbolTableListTraits >" = type { ptr, ptr } %"struct.llvm::SymbolTableListTraits >" = type { ptr, ptr } %"struct.llvm::DataLayout" = type { %"struct.llvm::FunctionPass", i1, i8, i8, i8, i8, i8, i8, i8, i8 } %"struct.llvm::TargetFrameInfo" = type { ptr, i32, i32, i32 } %"struct.llvm::TargetInstrDescriptor" = type { ptr, i32, i32, i32, i1, i32, i32, i32, i32, i32, ptr, ptr } %"struct.llvm::TargetInstrInfo" = type { ptr, ptr, i32, i32 } %"struct.llvm::TargetMachine" = type { ptr, %"struct.std::basic_string,std::allocator >", %"struct.llvm::DataLayout", ptr } %"struct.llvm::TargetRegClassInfo" = type { ptr, i32, i32, i32 } %"struct.llvm::TargetRegInfo" = type { ptr, %"struct.std::vector >", ptr } %"struct.llvm::Type" = type { %"struct.llvm::Value", i32, i32, i1, i32, ptr, %"struct.std::vector >" } %"struct.llvm::Use" = type { ptr, ptr, ptr, ptr } %"struct.llvm::User" = type { %"struct.llvm::Value", %"struct.std::vector >" } %"struct.llvm::Value" = type { ptr, %"struct.llvm::iplist >", %"struct.std::basic_string,std::allocator >", %"struct.llvm::PATypeHolder", i32 } %"struct.llvm::_GLOBAL__N_::InsertPrologEpilogCode" = type { %"struct.llvm::MachineFunctionPass" } %"struct.llvm::ilist" = type { %"struct.llvm::iplist >" } %"struct.llvm::ilist_iterator" = type { ptr } %"struct.llvm::ilist_traits" = type { %"struct.llvm::SymbolTableListTraits >" } %"struct.llvm::ilist_traits" = type { %"struct.llvm::SymbolTableListTraits >" } %"struct.llvm::iplist >" = type { %"struct.llvm::ilist_traits", ptr, ptr } %"struct.llvm::iplist >" = type { %"struct.llvm::ilist_traits", ptr, ptr } %"struct.llvm::iplist >" = type { %"struct.llvm::ilist_traits", ptr, ptr } %"struct.llvm::iplist >" = type { ptr, ptr } %"struct.llvm::iplist >" = type { %"struct.llvm::ilist_iterator", ptr, ptr } %"struct.llvm::iplist >" = type { ptr, ptr } %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_nodeptr,std::allocator, true>" = type { ptr, ptr, ptr } %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node >*,std::allocator, true>" = type { ptr, ptr, ptr } %"struct.std::_Vector_alloc_base, true>" = type { ptr, ptr, ptr } %"struct.std::_Vector_alloc_base, true>" = type { ptr, ptr, ptr } %"struct.std::_Vector_alloc_base, true>" = type { ptr, ptr, ptr } %"struct.std::_Vector_alloc_base, true>" = type { ptr, ptr, ptr } %"struct.std::_Vector_alloc_base, true>" = type { ptr, ptr, ptr } %"struct.std::_Vector_alloc_base, true>" = type { ptr, ptr, ptr } %"struct.std::_Vector_alloc_base, true>" = type { ptr, ptr, ptr } %"struct.std::_Vector_alloc_base,std::allocator >, true>" = type { ptr, ptr, ptr } %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_nodeptr,std::allocator >" = type { %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_nodeptr,std::allocator, true>" } %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_node >*,std::allocator >" = type { %"struct.std::_Vector_alloc_base<__gnu_cxx::_Hashtable_node >*,std::allocator, true>" } %"struct.std::_Vector_base >" = type { %"struct.std::_Vector_alloc_base, true>" } %"struct.std::_Vector_base >" = type { %"struct.std::_Vector_alloc_base, true>" } %"struct.std::_Vector_base >" = type { %"struct.std::_Vector_alloc_base, true>" } %"struct.std::_Vector_base >" = type { %"struct.std::_Vector_alloc_base, true>" } %"struct.std::_Vector_base >" = type { %"struct.std::_Vector_alloc_base, true>" } %"struct.std::_Vector_base >" = type { %"struct.std::_Vector_alloc_base, true>" } %"struct.std::_Vector_base >" = type { %"struct.std::_Vector_alloc_base, true>" } %"struct.std::_Vector_base,std::allocator > >" = type { %"struct.std::_Vector_alloc_base,std::allocator >, true>" } %"struct.std::basic_string,std::allocator >" = type { %"struct.std::basic_string,std::allocator >::_Alloc_hider" } %"struct.std::basic_string,std::allocator >::_Alloc_hider" = type { ptr } %"struct.std::pair" = type { ptr, ptr } %"struct.std::pair" = type { ptr, i32 } %"struct.std::type_info" = type { ptr, ptr } %"struct.std::vector<__gnu_cxx::_Hashtable_nodeptr,std::allocator >" = type { %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_nodeptr,std::allocator >" } %"struct.std::vector<__gnu_cxx::_Hashtable_node >*,std::allocator >" = type { %"struct.std::_Vector_base<__gnu_cxx::_Hashtable_node >*,std::allocator >" } %"struct.std::vector >" = type { %"struct.std::_Vector_base >" } %"struct.std::vector >" = type { %"struct.std::_Vector_base >" } %"struct.std::vector >" = type { %"struct.std::_Vector_base >" } %"struct.std::vector >" = type { %"struct.std::_Vector_base >" } %"struct.std::vector >" = type { %"struct.std::_Vector_base >" } %"struct.std::vector >" = type { %"struct.std::_Vector_base >" } %"struct.std::vector >" = type { %"struct.std::_Vector_base >" } %"struct.std::vector,std::allocator > >" = type { %"struct.std::_Vector_base,std::allocator > >" } %"union.llvm::MachineOperand::._65" = type { ptr } declare void @_Znwj() declare void @_ZN4llvm12MachineInstrC1Esjbb() declare void @_ZNSt6vectorIPN4llvm12MachineInstrESaIS2_EE9push_backERKS2_() declare void @_ZNK4llvm8Function15getFunctionTypeEv() declare void @_ZNK4llvm19MachineInstrBuilder7addMRegEiNS_14MachineOperand7UseTypeE() declare void @_ZNK4llvm19MachineInstrBuilder7addSImmEi() declare i32 @__gxx_personality_v0(...) define void @_ZN4llvm11_GLOBAL__N_22InsertPrologEpilogCode20runOnMachineFunctionERNS_15MachineFunctionE(ptr %F) personality ptr @__gxx_personality_v0 { entry: %tmp.8.i = invoke ptr null( ptr null ) to label %invoke_cont.0.i unwind label %invoke_catch.0.i ; [#uses=0] invoke_catch.0.i: ; preds = %invoke_cont.49.i, %invoke_cont.48.i, %invoke_cont.47.i, %invoke_cont.i53.i, %no_exit.i, %invoke_cont.44.i, %invoke_cont.43.i, %invoke_cont.42.i, %invoke_cont.41.i, %invoke_cont.40.i, %invoke_cont.39.i, %invoke_cont.38.i, %invoke_cont.37.i, %then.2.i, %invoke_cont.35.i, %invoke_cont.34.i, %then.1.i, %endif.0.i, %invoke_cont.9.i, %invoke_cont.8.i, %invoke_cont.7.i, %invoke_cont.i.i, %then.0.i, %invoke_cont.4.i, %invoke_cont.3.i, %invoke_cont.2.i, %invoke_cont.1.i, %endif.0.i.i, %tmp.7.i.noexc.i, %invoke_cont.0.i, %entry %exn0.i = landingpad {ptr, i32} cleanup ret void invoke_cont.0.i: ; preds = %entry %tmp.7.i1.i = invoke ptr null( ptr null ) to label %tmp.7.i.noexc.i unwind label %invoke_catch.0.i ; [#uses=2] tmp.7.i.noexc.i: ; preds = %invoke_cont.0.i %tmp.17.i2.i = invoke i32 null( ptr %tmp.7.i1.i ) to label %endif.0.i.i unwind label %invoke_catch.0.i ; [#uses=0] endif.0.i.i: ; preds = %tmp.7.i.noexc.i %tmp.38.i4.i = invoke i32 null( ptr %tmp.7.i1.i ) to label %tmp.38.i.noexc.i unwind label %invoke_catch.0.i ; [#uses=0] tmp.38.i.noexc.i: ; preds = %endif.0.i.i br i1 false, label %invoke_cont.1.i, label %then.1.i.i then.1.i.i: ; preds = %tmp.38.i.noexc.i ret void invoke_cont.1.i: ; preds = %tmp.38.i.noexc.i %tmp.21.i = invoke ptr null( ptr null ) to label %invoke_cont.2.i unwind label %invoke_catch.0.i ; [#uses=1] invoke_cont.2.i: ; preds = %invoke_cont.1.i %tmp.28.i = invoke i32 null( ptr %tmp.21.i ) to label %invoke_cont.3.i unwind label %invoke_catch.0.i ; [#uses=0] invoke_cont.3.i: ; preds = %invoke_cont.2.i %tmp.36.i = invoke ptr null( ptr null ) to label %invoke_cont.4.i unwind label %invoke_catch.0.i ; [#uses=1] invoke_cont.4.i: ; preds = %invoke_cont.3.i %tmp.43.i = invoke i1 null( ptr %tmp.36.i, i16 383, i64 0 ) to label %invoke_cont.5.i unwind label %invoke_catch.0.i ; [#uses=1] invoke_cont.5.i: ; preds = %invoke_cont.4.i br i1 %tmp.43.i, label %then.0.i, label %else.i then.0.i: ; preds = %invoke_cont.5.i invoke void @_Znwj( ) to label %tmp.0.i.noexc.i unwind label %invoke_catch.0.i tmp.0.i.noexc.i: ; preds = %then.0.i invoke void @_ZN4llvm12MachineInstrC1Esjbb( ) to label %invoke_cont.i.i unwind label %cond_true.i.i cond_true.i.i: ; preds = %tmp.0.i.noexc.i %exn.i.i = landingpad {ptr, i32} cleanup ret void invoke_cont.i.i: ; preds = %tmp.0.i.noexc.i invoke void @_ZNK4llvm19MachineInstrBuilder7addMRegEiNS_14MachineOperand7UseTypeE( ) to label %invoke_cont.7.i unwind label %invoke_catch.0.i invoke_cont.7.i: ; preds = %invoke_cont.i.i invoke void @_ZNK4llvm19MachineInstrBuilder7addSImmEi( ) to label %invoke_cont.8.i unwind label %invoke_catch.0.i invoke_cont.8.i: ; preds = %invoke_cont.7.i invoke void @_ZNK4llvm19MachineInstrBuilder7addMRegEiNS_14MachineOperand7UseTypeE( ) to label %invoke_cont.9.i unwind label %invoke_catch.0.i invoke_cont.9.i: ; preds = %invoke_cont.8.i invoke void @_ZNSt6vectorIPN4llvm12MachineInstrESaIS2_EE9push_backERKS2_( ) to label %endif.0.i unwind label %invoke_catch.0.i else.i: ; preds = %invoke_cont.5.i ret void endif.0.i: ; preds = %invoke_cont.9.i invoke void @_ZNK4llvm8Function15getFunctionTypeEv( ) to label %invoke_cont.33.i unwind label %invoke_catch.0.i invoke_cont.33.i: ; preds = %endif.0.i br i1 false, label %then.1.i, label %endif.1.i then.1.i: ; preds = %invoke_cont.33.i invoke void @_ZNK4llvm8Function15getFunctionTypeEv( ) to label %invoke_cont.34.i unwind label %invoke_catch.0.i invoke_cont.34.i: ; preds = %then.1.i %tmp.121.i = invoke ptr null( ptr null ) to label %invoke_cont.35.i unwind label %invoke_catch.0.i ; [#uses=1] invoke_cont.35.i: ; preds = %invoke_cont.34.i %tmp.128.i = invoke i32 null( ptr %tmp.121.i ) to label %invoke_cont.36.i unwind label %invoke_catch.0.i ; [#uses=0] invoke_cont.36.i: ; preds = %invoke_cont.35.i br i1 false, label %then.2.i, label %endif.1.i then.2.i: ; preds = %invoke_cont.36.i %tmp.140.i = invoke ptr null( ptr null ) to label %invoke_cont.37.i unwind label %invoke_catch.0.i ; [#uses=0] invoke_cont.37.i: ; preds = %then.2.i %tmp.148.i = invoke ptr null( ptr null ) to label %invoke_cont.38.i unwind label %invoke_catch.0.i ; [#uses=1] invoke_cont.38.i: ; preds = %invoke_cont.37.i %tmp.155.i = invoke i32 null( ptr %tmp.148.i, ptr null, i1 false ) to label %invoke_cont.39.i unwind label %invoke_catch.0.i ; [#uses=0] invoke_cont.39.i: ; preds = %invoke_cont.38.i %tmp.163.i = invoke ptr null( ptr null ) to label %invoke_cont.40.i unwind label %invoke_catch.0.i ; [#uses=1] invoke_cont.40.i: ; preds = %invoke_cont.39.i %tmp.170.i = invoke i32 null( ptr %tmp.163.i ) to label %invoke_cont.41.i unwind label %invoke_catch.0.i ; [#uses=0] invoke_cont.41.i: ; preds = %invoke_cont.40.i %tmp.177.i = invoke ptr null( ptr null ) to label %invoke_cont.42.i unwind label %invoke_catch.0.i ; [#uses=1] invoke_cont.42.i: ; preds = %invoke_cont.41.i %tmp.184.i = invoke i32 null( ptr %tmp.177.i ) to label %invoke_cont.43.i unwind label %invoke_catch.0.i ; [#uses=1] invoke_cont.43.i: ; preds = %invoke_cont.42.i %tmp.191.i = invoke ptr null( ptr null ) to label %invoke_cont.44.i unwind label %invoke_catch.0.i ; [#uses=1] invoke_cont.44.i: ; preds = %invoke_cont.43.i %tmp.198.i = invoke i32 null( ptr %tmp.191.i, ptr %F, ptr null ) to label %invoke_cont.45.i unwind label %invoke_catch.0.i ; [#uses=0] invoke_cont.45.i: ; preds = %invoke_cont.44.i br i1 false, label %no_exit.i, label %endif.1.i no_exit.i: ; preds = %invoke_cont.50.i, %invoke_cont.45.i %nextArgOffset.0.i.1 = phi i32 [ %tmp.221.i, %invoke_cont.50.i ], [ 0, %invoke_cont.45.i ] ; [#uses=1] invoke void @_Znwj( ) to label %tmp.0.i.noexc55.i unwind label %invoke_catch.0.i tmp.0.i.noexc55.i: ; preds = %no_exit.i invoke void @_ZN4llvm12MachineInstrC1Esjbb( ) to label %invoke_cont.i53.i unwind label %cond_true.i52.i cond_true.i52.i: ; preds = %tmp.0.i.noexc55.i %exn.i52.i = landingpad {ptr, i32} cleanup ret void invoke_cont.i53.i: ; preds = %tmp.0.i.noexc55.i invoke void @_ZNK4llvm19MachineInstrBuilder7addMRegEiNS_14MachineOperand7UseTypeE( ) to label %invoke_cont.47.i unwind label %invoke_catch.0.i invoke_cont.47.i: ; preds = %invoke_cont.i53.i invoke void @_ZNK4llvm19MachineInstrBuilder7addMRegEiNS_14MachineOperand7UseTypeE( ) to label %invoke_cont.48.i unwind label %invoke_catch.0.i invoke_cont.48.i: ; preds = %invoke_cont.47.i invoke void @_ZNK4llvm19MachineInstrBuilder7addSImmEi( ) to label %invoke_cont.49.i unwind label %invoke_catch.0.i invoke_cont.49.i: ; preds = %invoke_cont.48.i invoke void @_ZNSt6vectorIPN4llvm12MachineInstrESaIS2_EE9push_backERKS2_( ) to label %invoke_cont.50.i unwind label %invoke_catch.0.i invoke_cont.50.i: ; preds = %invoke_cont.49.i %tmp.221.i = add i32 %nextArgOffset.0.i.1, %tmp.184.i ; [#uses=1] br i1 false, label %no_exit.i, label %endif.1.i endif.1.i: ; preds = %invoke_cont.50.i, %invoke_cont.45.i, %invoke_cont.36.i, %invoke_cont.33.i ret void }