1 ; Test that we don't sink landingpads 2 ; RUN: opt -sink -S < %s | FileCheck %s 3 4 declare hidden void @g() 5 declare void @h() 6 declare i32 @__gxx_personality_v0(...) 7 8 define void @f() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { 9 entry: 10 invoke void @g() 11 to label %invoke.cont.15 unwind label %lpad 12 13 invoke.cont.15: 14 unreachable 15 16 ; CHECK: lpad: 17 ; CHECK: %0 = landingpad { i8*, i32 } 18 lpad: 19 %0 = landingpad { i8*, i32 } 20 catch i8* null 21 invoke void @h() 22 to label %invoke.cont unwind label %lpad.1 23 24 ; CHECK: invoke.cont 25 ; CHECK-NOT: %0 = landingpad { i8*, i32 } 26 invoke.cont: 27 ret void 28 29 lpad.1: 30 %1 = landingpad { i8*, i32 } 31 cleanup 32 resume { i8*, i32 } %1 33 } 34