indirect-branch-tracking-eh.ll
3.12 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s --check-prefix=X86_64
; RUN: llc -mtriple=i386-unknown-unknown < %s | FileCheck %s --check-prefix=X86
; RUN: llc -mtriple i386-windows-gnu -exception-model sjlj -verify-machineinstrs=0 < %s | FileCheck %s --check-prefix=SJLJ
; RUN: llc -mtriple i386-windows-gnu -exception-model sjlj -verify-machineinstrs=0 < %s | FileCheck %s --check-prefix=NUM
; X86_64: test_eh: # @test_eh
; X86_64-NEXT: .Lfunc_begin0:
; X86_64: # %bb.0: # %entry
; X86_64-NEXT: endbr64
; X86_64-NEXT: pushq %rax
; X86_64: .Ltmp0:
; X86_64-NEXT: callq _Z20function_that_throwsv
; X86_64-NEXT: .Ltmp1:
; X86_64-NEXT: # %bb.1: # %try.cont
; X86_64: retq
; X86_64-NEXT: .LBB0_2: # %lpad
; X86_64-NEXT: .cfi_def_cfa_offset 16
; X86_64-NEXT: .Ltmp2:
; X86_64-NEXT: endbr64
; X86_64: callq __cxa_begin_catch
; X86: test_eh: # @test_eh
; X86-NEXT: .Lfunc_begin0:
; X86: # %bb.0: # %entry
; X86-NEXT: endbr32
; X86-NEXT: .Ltmp0:
; X86: calll _Z20function_that_throwsv
; X86-NEXT: .Ltmp1:
; X86-NEXT: # %bb.1: # %try.cont
; X86-NEXT: retl
; X86-NEXT: .LBB0_2: # %lpad
; X86-NEXT: .Ltmp2:
; X86-NEXT: endbr32
; X86: calll __cxa_begin_catch
; NUM-COUNT-3: endbr32
; SJLJ: test_eh:
; SJLJ-NEXT: Lfunc_begin0:
; SJLJ-NEXT: # %bb.0: # %entry
; SJLJ-NEXT: endbr32
; SJLJ: calll __Unwind_SjLj_Register
; SJLJ: Ltmp0:
; SJLJ: calll __Z20function_that_throwsv
; SJLJ: LBB0_2: # %try.cont
; SJLJ: calll __Unwind_SjLj_Unregister
; SJLJ: retl
; SJLJ: LBB0_3:
; SJLJ-NEXT: endbr32
; SJLJ-NEXT: leal
; SJLJ-NEXT: movl
; SJLJ-NEXT: cmpl
; SJLJ-NEXT: jb LBB0_4
; SJLJ: LBB0_4:
; SJLJ-NEXT: jmpl *LJTI0_0(,%eax,4)
; SJLJ: LBB0_6: # %lpad
; SJLJ-NEXT: Ltmp2:
; SJLJ-NEXT: endbr32
; SJLJ: calll ___cxa_begin_catch
; SJLJ: jmp LBB0_2
; SJLJ: LJTI0_0:
; SJLJ-NEXT: .long LBB0_6
declare void @_Z20function_that_throwsv()
declare i32 @__gxx_personality_sj0(...)
declare i8* @__cxa_begin_catch(i8*)
declare void @__cxa_end_catch()
define void @test_eh() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
invoke void @_Z20function_that_throwsv()
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
}
!llvm.module.flags = !{!0}
!0 = !{i32 4, !"cf-protection-branch", i32 1}