cfi-basic-block-sections-1.ll
2.44 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
; RUN: llc -O0 %s --basic-block-sections=all -mtriple=x86_64 -filetype=asm --frame-pointer=all -o - | FileCheck --check-prefix=SECTIONS_CFI %s
; RUN: llc -O0 %s --basic-block-sections=all -mtriple=x86_64 -filetype=asm --frame-pointer=none -o - | FileCheck --check-prefix=SECTIONS_NOFP_CFI %s
; RUN: llc -O0 %s --basic-block-sections=all -mtriple=x86_64 -filetype=obj --frame-pointer=all -o - | llvm-dwarfdump --eh-frame - | FileCheck --check-prefix=EH_FRAME %s
;; void f1();
;; void f3(bool b) {
;; if (b)
;; f1();
;; }
; SECTIONS_CFI: _Z2f3b:
; SECTIONS_CFI: .cfi_startproc
; SECTIONS_CFI: .cfi_def_cfa_offset 16
; SECTIONS_CFI: .cfi_offset %rbp, -16
; SECTIONS_CFI: .cfi_def_cfa_register %rbp
; SECTIONS_CFI: .cfi_endproc
; SECTIONS_CFI: _Z2f3b.1:
; SECTIONS_CFI-NEXT: .cfi_startproc
; SECTIONS_CFI-NEXT: .cfi_def_cfa %rbp, 16
; SECTIONS_CFI-NEXT: .cfi_offset %rbp, -16
; SECTIONS_CFI: .cfi_endproc
; SECTIONS_CFI: _Z2f3b.2:
; SECTIONS_CFI-NEXT: .cfi_startproc
; SECTIONS_CFI-NEXT: .cfi_def_cfa %rbp, 16
; SECTIONS_CFI-NEXT: .cfi_offset %rbp, -16
; SECTIONS_CFI: .cfi_def_cfa
; SECTIONS_CFI: .cfi_endproc
; SECTIONS_NOFP_CFI: _Z2f3b:
; SECTIONS_NOFP_CFI: .cfi_startproc
; SECTIONS_NOFP_CFI: .cfi_def_cfa_offset 16
; SECTIONS_NOFP_CFI: .cfi_endproc
; SECTIONS_NOFP_CFI: _Z2f3b.1:
; SECTIONS_NOFP_CFI-NEXT: .cfi_startproc
; SECTIONS_NOFP_CFI-NEXT: .cfi_def_cfa %rsp, 16
; SECTIONS_NOFP_CFI: .cfi_endproc
; SECTIONS_NOFP_CFI: _Z2f3b.2:
; SECTIONS_NOFP_CFI-NEXT: .cfi_startproc
; SECTIONS_NOFP_CFI-NEXT: .cfi_def_cfa %rsp, 16
; SECTIONS_NOFP_CFI: .cfi_endproc
;; There must be 1 CIE and 3 FDEs.
; EH_FRAME: CIE
; EH_FRAME: DW_CFA_def_cfa
; EH_FRAME: DW_CFA_offset
; EH_FRAME: FDE cie=
; EH_FRAME: DW_CFA_def_cfa_offset
; EH_FRAME: DW_CFA_offset
; EH_FRAME: DW_CFA_def_cfa_register
; EH_FRAME: FDE cie=
; EH_FRAME: DW_CFA_def_cfa
; EH_FRAME: DW_CFA_offset
; EH_FRAME: FDE cie=
; EH_FRAME: DW_CFA_def_cfa
; EH_FRAME: DW_CFA_offset
; Function Attrs: noinline optnone uwtable
define dso_local void @_Z2f3b(i1 zeroext %b) {
entry:
%b.addr = alloca i8, align 1
%frombool = zext i1 %b to i8
store i8 %frombool, i8* %b.addr, align 1
%0 = load i8, i8* %b.addr, align 1
%tobool = trunc i8 %0 to i1
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
call void @_Z2f1v()
br label %if.end
if.end: ; preds = %if.then, %entry
ret void
}
declare dso_local void @_Z2f1v()