13f8027fbSBjorn Pettersson; RUN: opt -passes=reg2mem -disable-output < %s 2cee313d2SEric Christopher; PR14782 3cee313d2SEric Christopher 4cee313d2SEric Christopherdeclare void @f1() 5cee313d2SEric Christopher 6cee313d2SEric Christopherdeclare i32 @__gxx_personality_sj0(...) 7cee313d2SEric Christopher 8cee313d2SEric Christopherdeclare void @f2() 9cee313d2SEric Christopher 10cee313d2SEric Christopherdeclare void @f3() 11cee313d2SEric Christopher 12cee313d2SEric Christopherdeclare void @f4_() 13cee313d2SEric Christopher 14cee313d2SEric Christopherdeclare void @_Z12xxxdtsP10xxxpq() 15cee313d2SEric Christopher 16*64539b17SMatt Arsenaultdefine hidden void @_ZN12xxxyzIi9xxxwLi29ELi0EE4f3NewES0_i() ssp align 2 personality ptr @__gxx_personality_sj0 { 17cee313d2SEric Christopherbb: 18cee313d2SEric Christopher invoke void @f4_() 19cee313d2SEric Christopher to label %bb1 unwind label %.thread 20cee313d2SEric Christopher 21cee313d2SEric Christopher.thread: ; preds = %bb 22*64539b17SMatt Arsenault %tmp = landingpad { ptr, i32 } 23cee313d2SEric Christopher cleanup 24cee313d2SEric Christopher br label %bb13 25cee313d2SEric Christopher 26cee313d2SEric Christopherbb1: ; preds = %bb 27cee313d2SEric Christopher invoke void @f1() 28cee313d2SEric Christopher to label %.noexc unwind label %bb10 29cee313d2SEric Christopher 30cee313d2SEric Christopher.noexc: ; preds = %bb1 31cee313d2SEric Christopher invoke void @f4_() 32cee313d2SEric Christopher to label %bb6 unwind label %bb2 33cee313d2SEric Christopher 34cee313d2SEric Christopherbb2: ; preds = %.noexc 35*64539b17SMatt Arsenault %tmp3 = landingpad { ptr, i32 } 36cee313d2SEric Christopher cleanup 37cee313d2SEric Christopher invoke void @f3() 38cee313d2SEric Christopher to label %.body unwind label %bb4 39cee313d2SEric Christopher 40cee313d2SEric Christopherbb4: ; preds = %bb2 41*64539b17SMatt Arsenault %tmp5 = landingpad { ptr, i32 } 42*64539b17SMatt Arsenault catch ptr null 43cee313d2SEric Christopher unreachable 44cee313d2SEric Christopher 45cee313d2SEric Christopherbb6: ; preds = %.noexc 46cee313d2SEric Christopher invoke void @_Z12xxxdtsP10xxxpq() 47cee313d2SEric Christopher to label %_ZN6xxxdIN12xxxyzIi9xxxwLi29ELi0EE4fr1jS3_.exit unwind label %bb10 48cee313d2SEric Christopher 49cee313d2SEric Christopher_ZN6xxxdIN12xxxyzIi9xxxwLi29ELi0EE4fr1jS3_.exit: ; preds = %bb6 50cee313d2SEric Christopher invoke void @f2() 51cee313d2SEric Christopher to label %bb7 unwind label %bb8 52cee313d2SEric Christopher 53cee313d2SEric Christopherbb7: ; preds = %_ZN6xxxdIN12xxxyzIi9xxxwLi29ELi0EE4fr1jS3_.exit 54cee313d2SEric Christopher ret void 55cee313d2SEric Christopher 56cee313d2SEric Christopherbb8: ; preds = %_ZN6xxxdIN12xxxyzIi9xxxwLi29ELi0EE4fr1jS3_.exit 57*64539b17SMatt Arsenault %tmp9 = landingpad { ptr, i32 } 58cee313d2SEric Christopher cleanup 59cee313d2SEric Christopher br label %_ZN10xxxpqdlev.exit 60cee313d2SEric Christopher 61cee313d2SEric Christopherbb10: ; preds = %bb6, %bb1 62cee313d2SEric Christopher %.1 = phi i1 [ true, %bb1 ], [ false, %bb6 ] 63*64539b17SMatt Arsenault %tmp11 = landingpad { ptr, i32 } 64cee313d2SEric Christopher cleanup 65cee313d2SEric Christopher br label %.body 66cee313d2SEric Christopher 67cee313d2SEric Christopher.body: ; preds = %bb10, %bb2 68cee313d2SEric Christopher %.1.lpad-body = phi i1 [ %.1, %bb10 ], [ true, %bb2 ] 69cee313d2SEric Christopher invoke void @f2() 70cee313d2SEric Christopher to label %bb12 unwind label %bb14 71cee313d2SEric Christopher 72cee313d2SEric Christopherbb12: ; preds = %.body 73cee313d2SEric Christopher br i1 %.1.lpad-body, label %bb13, label %_ZN10xxxpqdlev.exit 74cee313d2SEric Christopher 75cee313d2SEric Christopherbb13: ; preds = %bb12, %.thread 76cee313d2SEric Christopher invoke void @xxx_MemFree() 77cee313d2SEric Christopher to label %_ZN10xxxpqdlev.exit unwind label %bb14 78cee313d2SEric Christopher 79cee313d2SEric Christopher_ZN10xxxpqdlev.exit: ; preds = %bb13, %bb12, %bb8 80*64539b17SMatt Arsenault resume { ptr, i32 } undef 81cee313d2SEric Christopher 82cee313d2SEric Christopherbb14: ; preds = %bb13, %.body 83*64539b17SMatt Arsenault %tmp15 = landingpad { ptr, i32 } 84*64539b17SMatt Arsenault catch ptr null 85cee313d2SEric Christopher unreachable 86cee313d2SEric Christopher} 87cee313d2SEric Christopher 88cee313d2SEric Christopherdeclare void @xxx_MemFree() 89