brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 9bb21b1 Raw
55 lines · plain
1; RUN: llc -mtriple x86_64-pc-linux-gnu < %s | FileCheck %s2 3; This test demonstrates that it is possible to use functions for typeinfo4; instead of global variables. While __gxx_personality_v0 would never know what5; to do with them, other EH schemes such as SEH might use them.6 7declare i32 @__gxx_personality_v0(...)8declare void @filt0()9declare void @filt1()10declare void @_Z1fv()11declare i32 @llvm.eh.typeid.for(ptr)12 13define i32 @main() uwtable personality ptr @__gxx_personality_v0 {14entry:15  invoke void @_Z1fv()16          to label %try.cont unwind label %lpad17 18try.cont:19  ret i32 020 21lpad:22  %0 = landingpad { ptr, i32 }23          cleanup24          catch ptr @filt025          catch ptr @filt126  %sel = extractvalue { ptr, i32 } %0, 127  %id0 = call i32 @llvm.eh.typeid.for(ptr @filt0)28  %is_f0 = icmp eq i32 %sel, %id029  br i1 %is_f0, label %try.cont, label %check_f130 31check_f1:32  %id1 = call i32 @llvm.eh.typeid.for(ptr @filt1)33  %is_f1 = icmp eq i32 %sel, %id134  br i1 %is_f1, label %try.cont, label %eh.resume35 36eh.resume:37  resume { ptr, i32 } %038}39 40; CHECK-LABEL: main:41; CHECK: .cfi_startproc42; CHECK: .cfi_personality 3, __gxx_personality_v043; CHECK: .cfi_lsda 3, .Lexception044; CHECK: .cfi_def_cfa_offset 1645; CHECK: callq _Z1fv46; CHECK: retq47; CHECK: cmpl $2, %edx48; CHECK: je49; CHECK: cmpl $1, %edx50; CHECK: je51; CHECK: callq _Unwind_Resume52; CHECK: .cfi_endproc53; CHECK: GCC_except_table0:54; CHECK: Lexception0:55