Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / cfi-instrs-count.s
blobadf28a9e0811f35ecc95ee033ccdf3464fbba711
1 # Check that llvm-bolt is able to read a file with DWARF Exception CFI
2 # information and annotate this into a disassembled function.
4 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
5 # RUN: %clang %cflags %t.o -o %t.exe
6 # RUN: llvm-bolt %t.exe -o /dev/null --print-cfg 2>&1 | FileCheck %s
7 #
8 # CHECK: Binary Function "_Z7catchitv" after building cfg {
9 # CHECK: CFI Instrs : 6
10 # CHECK: }
11 # CHECK: DWARF CFI Instructions:
12 # CHECK: 0: OpDefCfaOffset
13 # CHECK: 1: OpOffset
14 # CHECK: 2: OpDefCfaRegister
15 # CHECK: 3: OpOffset
16 # CHECK: 4: OpOffset
17 # CHECK: 5: OpDefCfa
18 # CHECK: End of Function "_Z7catchitv"
20 .text
21 .globl main
22 .type main, %function
23 main:
24 # FDATA: 0 [unknown] 0 1 main 0 0 0
25 .cfi_startproc
26 .LBB000:
27 pushq %rbp
28 .cfi_def_cfa_offset 16
29 .cfi_offset %rbp, -16
30 movq %rsp, %rbp
31 .cfi_def_cfa_register %rbp
32 movl $0x400c4c, %esi
33 movl $0x6012e0, %edi
34 callq _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
35 movl $0x400908, %esi
36 movq %rax, %rdi
37 callq _ZNSolsEPFRSoS_E@PLT
38 callq _Z7catchitv
39 movl $0x0, %eax
40 leave
41 .cfi_def_cfa %rsp, 8
42 retq
44 .cfi_endproc
45 .size main, .-main
47 .globl _Z7catchitv
48 .type _Z7catchitv, %function
49 _Z7catchitv:
50 # FDATA: 0 [unknown] 0 1 _Z7catchitv 0 0 0
51 .cfi_startproc
52 .LBB00:
53 pushq %rbp
54 .cfi_def_cfa_offset 16
55 .cfi_offset %rbp, -16
56 movq %rsp, %rbp
57 .cfi_def_cfa_register %rbp
58 pushq %r12
59 pushq %rbx
60 subq $0x10, %rsp
61 .cfi_offset %rbx, -32
62 .cfi_offset %r12, -24
63 callq _Z5raisev
64 .LBB00_br: jmp .Ltmp0
65 # FDATA: 1 _Z7catchitv #.LBB00_br# 1 _Z7catchitv #.Ltmp0# 0 0
67 .LLP0:
68 cmpq $0x1, %rdx
69 .LLP0_br: je .Ltmp1
70 # FDATA: 1 _Z7catchitv #.LLP0_br# 1 _Z7catchitv #.Ltmp1# 0 0
71 # FDATA: 1 _Z7catchitv #.LLP0_br# 1 _Z7catchitv #.LFT0# 0 0
73 .LFT0:
74 movq %rax, %rdi
75 .LFT0_br: callq _Unwind_Resume@PLT
76 # FDATA: 1 _Z7catchitv #.LFT0_br# 1 _Z7catchitv #.Ltmp1# 0 0
78 .Ltmp1:
79 movq %rax, %rdi
80 callq __cxa_begin_catch@PLT
81 movq %rax, -0x18(%rbp)
82 movl $0x400c40, %esi
83 movl $0x6012e0, %edi
84 callq _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
85 .Ltmp1_br: jmp .Ltmp2
86 # FDATA: 1 _Z7catchitv #.Ltmp1_br# 1 _Z7catchitv #.Ltmp2# 0 0
88 .LLP1:
89 movl %edx, %ebx
90 movq %rax, %r12
91 callq __cxa_end_catch@PLT
92 movq %r12, %rax
93 movslq %ebx, %rdx
94 movq %rax, %rdi
95 .LLP1_br: callq _Unwind_Resume@PLT
96 # FDATA: 1 _Z7catchitv #.LLP1_br# 1 _Z7catchitv #.Ltmp2# 0 0
98 .Ltmp2:
99 .Ltmp2_br: callq __cxa_end_catch@PLT
100 # FDATA: 1 _Z7catchitv #.Ltmp2_br# 1 _Z7catchitv #.Ltmp0# 0 0
102 .Ltmp0:
103 addq $0x10, %rsp
104 popq %rbx
105 popq %r12
106 leave
107 .cfi_def_cfa %rsp, 8
108 retq
110 .cfi_endproc
111 .size _Z7catchitv, .-_Z7catchitv