dwarf-eh.ll
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
; RUN: llc -march=riscv32 --code-model=small < %s \
; RUN: | FileCheck %s
; RUN: llc -march=riscv32 --code-model=medium < %s \
; RUN: | FileCheck %s
; RUN: llc -march=riscv32 --code-model=small -relocation-model=pic < %s \
; RUN: | FileCheck %s
; RUN: llc -march=riscv32 --code-model=medium -relocation-model=pic < %s \
; RUN: | FileCheck %s
; RUN: llc -march=riscv64 --code-model=small < %s \
; RUN: | FileCheck %s
; RUN: llc -march=riscv64 --code-model=medium < %s \
; RUN: | FileCheck %s
; RUN: llc -march=riscv64 --code-model=small -relocation-model=pic < %s \
; RUN: | FileCheck %s
; RUN: llc -march=riscv64 --code-model=medium -relocation-model=pic < %s \
; RUN: | FileCheck %s
declare void @throw_exception()
declare i32 @__gxx_personality_v0(...)
declare i8* @__cxa_begin_catch(i8*)
declare void @__cxa_end_catch()
; CHECK-LABEL: test1:
; CHECK: .cfi_startproc
; PersonalityEncoding = DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4
; CHECK-NEXT: .cfi_personality 155, DW.ref.__gxx_personality_v0
; LSDAEncoding = DW_EH_PE_pcrel | DW_EH_PE_sdata4
; CHECK-NEXT: .cfi_lsda 27, .Lexception0
define void @test1() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throw_exception() to label %try.cont unwind label %lpad
lpad:
%0 = landingpad { i8*, i32 }
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
%2 = tail call i8* @__cxa_begin_catch(i8* %1)
tail call void @__cxa_end_catch()
br label %try.cont
try.cont:
ret void
}
; CHECK-LABEL: GCC_except_table0:
; CHECK-NEXT: .Lexception0:
; CHECK-NEXT: .byte 255 # @LPStart Encoding = omit
; TTypeEncoding = DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4
; CHECK-NEXT: .byte 155 # @TType Encoding = indirect pcrel sdata4
; CHECK: .Lttbaseref0:
; CallSiteEncoding = dwarf::DW_EH_PE_udata4
; CHECK-NEXT: .byte 3 # Call site Encoding = udata4
; CHECK-NEXT: .uleb128 .Lcst_end0-.Lcst_begin0
; CHECK-NEXT: cst_begin0:
; CHECK-NEXT: .word .Ltmp0-.Lfunc_begin0 # >> Call Site 1 <<
; CHECK-NEXT: .word .Ltmp1-.Ltmp0 # Call between .Ltmp0 and .Ltmp1
; CHECK-NEXT: .word .Ltmp2-.Lfunc_begin0 # jumps to .Ltmp2
; CHECK-NEXT: .byte 1 # On action: 1
; CHECK-NEXT: .word .Ltmp1-.Lfunc_begin0 # >> Call Site 2 <<
; CHECK-NEXT: .word .Lfunc_end0-.Ltmp1 # Call between .Ltmp1 and .Lfunc_end0
; CHECK-NEXT: .word 0 # has no landing pad
; CHECK-NEXT: .byte 0 # On action: cleanup