1## Check that llvm-bolt is able to read a file with DWARF Exception CFI 2## information and annotate this into a disassembled function. 3 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 %t.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" 19 20 .text 21 .globl main 22 .type main, %function 23main: 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 43 44 .cfi_endproc 45.size main, .-main 46 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 66 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 72 73.LFT0: 74 movq %rax, %rdi 75.LFT0_br: callq _Unwind_Resume@PLT 76# FDATA: 1 _Z7catchitv #.LFT0_br# 1 _Z7catchitv #.Ltmp1# 0 0 77 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 87 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 97 98.Ltmp2: 99.Ltmp2_br: callq __cxa_end_catch@PLT 100# FDATA: 1 _Z7catchitv #.Ltmp2_br# 1 _Z7catchitv #.Ltmp0# 0 0 101 102.Ltmp0: 103 addq $0x10, %rsp 104 popq %rbx 105 popq %r12 106 leave 107 .cfi_def_cfa %rsp, 8 108 retq 109 110 .cfi_endproc 111.size _Z7catchitv, .-_Z7catchitv 112