1 ; RUN: llc -mtriple=riscv32 --code-model=small < %s \
3 ; RUN: llc -mtriple=riscv32 --code-model=medium < %s \
5 ; RUN: llc -mtriple=riscv32 --code-model=small -relocation-model=pic < %s \
7 ; RUN: llc -mtriple=riscv32 --code-model=medium -relocation-model=pic < %s \
9 ; RUN: llc -mtriple=riscv64 --code-model=small < %s \
11 ; RUN: llc -mtriple=riscv64 --code-model=medium < %s \
13 ; RUN: llc -mtriple=riscv64 --code-model=small -relocation-model=pic < %s \
15 ; RUN: llc -mtriple=riscv64 --code-model=medium -relocation-model=pic < %s \
18 declare void @throw_exception()
20 declare i32 @__gxx_personality_v0(...)
22 declare ptr @__cxa_begin_catch(ptr)
24 declare void @__cxa_end_catch()
27 ; CHECK: .cfi_startproc
28 ; PersonalityEncoding = DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4
29 ; CHECK-NEXT: .cfi_personality 155, DW.ref.__gxx_personality_v0
30 ; LSDAEncoding = DW_EH_PE_pcrel | DW_EH_PE_sdata4
31 ; CHECK-NEXT: .cfi_lsda 27, .Lexception0
33 define void @test1() personality ptr @__gxx_personality_v0 {
35 invoke void @throw_exception() to label %try.cont unwind label %lpad
38 %0 = landingpad { ptr, i32 }
40 %1 = extractvalue { ptr, i32 } %0, 0
41 %2 = tail call ptr @__cxa_begin_catch(ptr %1)
42 tail call void @__cxa_end_catch()
49 ; CHECK-LABEL: GCC_except_table0:
50 ; CHECK-NEXT: .Lexception0:
51 ; CHECK-NEXT: .byte 255 # @LPStart Encoding = omit
52 ; TTypeEncoding = DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4
53 ; CHECK-NEXT: .byte 155 # @TType Encoding = indirect pcrel sdata4
54 ; CHECK: .Lttbaseref0:
55 ; CallSiteEncoding = dwarf::DW_EH_PE_udata4
56 ; CHECK-NEXT: .byte 3 # Call site Encoding = udata4
57 ; CHECK-NEXT: .uleb128 .Lcst_end0-.Lcst_begin0
58 ; CHECK-NEXT: cst_begin0:
59 ; CHECK-NEXT: .word .Ltmp0-.Lfunc_begin0 # >> Call Site 1 <<
60 ; CHECK-NEXT: .word .Ltmp1-.Ltmp0 # Call between .Ltmp0 and .Ltmp1
61 ; CHECK-NEXT: .word .Ltmp2-.Lfunc_begin0 # jumps to .Ltmp2
62 ; CHECK-NEXT: .byte 1 # On action: 1
63 ; CHECK-NEXT: .word .Ltmp1-.Lfunc_begin0 # >> Call Site 2 <<
64 ; CHECK-NEXT: .word .Lfunc_end0-.Ltmp1 # Call between .Ltmp1 and .Lfunc_end0
65 ; CHECK-NEXT: .word 0 # has no landing pad
66 ; CHECK-NEXT: .byte 0 # On action: cleanup