1 ; RUN: opt -bdce -S < %s | FileCheck %s 2 3 declare i32 @strlen(i8*) readonly nounwind 4 5 define void @test1() { 6 call i32 @strlen( i8* null ) 7 ret void 8 9 ; CHECK-LABEL: @test1 10 ; CHECK-NOT: call 11 ; CHECK: ret void 12 } 13 14 define i32 @test2() personality i32 (...)* @__gxx_personality_v0 { 15 ; invoke of pure function should not be deleted! 16 invoke i32 @strlen( i8* null ) readnone 17 to label %Cont unwind label %Other 18 19 Cont: ; preds = %0 20 ret i32 0 21 22 Other: ; preds = %0 23 %exn = landingpad {i8*, i32} 24 cleanup 25 ret i32 1 26 27 ; CHECK-LABEL: @test2 28 ; CHECK: invoke 29 ; CHECK: ret i32 1 30 } 31 32 declare i32 @__gxx_personality_v0(...) 33 34