1 ; REQUIRES: x86_64-linux
2 ; RUN: opt < %s -passes=pseudo-probe -function-sections -S -o - | FileCheck %s
4 ;; Check the generation of pseudoprobe intrinsic call for non-EH blocks only.
6 declare i32 @__gxx_personality_v0(...)
7 declare i32 @llvm.eh.typeid.for(ptr) nounwind
8 declare ptr @__cxa_begin_catch(ptr)
9 declare void @__cxa_end_catch()
12 @_ZTIi = external constant ptr
14 define void @foo() uwtable ssp personality ptr @__gxx_personality_v0 {
16 ; CHECK: call void @llvm.pseudoprobe
18 to label %ret unwind label %lpad
21 ; CHECK: call void @llvm.pseudoprobe
24 lpad: ; preds = %entry
25 ; CHECK-NOT: call void @llvm.pseudoprobe
26 %exn = landingpad {ptr, i32}
28 %eh.exc = extractvalue { ptr, i32 } %exn, 0
29 %eh.selector = extractvalue { ptr, i32 } %exn, 1
30 %0 = call i32 @llvm.eh.typeid.for(ptr @_ZTIi) nounwind
31 %1 = icmp eq i32 %eh.selector, %0
32 br i1 %1, label %catch, label %eh.resume
35 ; CHECK-NOT: call void @llvm.pseudoprobe
36 %ignored = call ptr @__cxa_begin_catch(ptr %eh.exc) nounwind
37 call void @__cxa_end_catch() nounwind
41 ; CHECK-NOT: call void @llvm.pseudoprobe
42 resume { ptr, i32 } %exn