159 lines · plain
1# REQUIRES: system-linux2 3# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o4# RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q5# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections6# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s7# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s8 9## This test checks we correctly insert DW_AT_addr_base, when converting DW_AT_low_pc into DW_AT_ranges.10## PRECHECK-NOT: DW_AT_addr_base11 12# POSTCHECK: DW_AT_ranges [DW_FORM_rnglistx]13# POSTCHECK: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c)14# POSTCHECK-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)15 16# int main() {17# return 0;18# }19 20 21 .file "main.cpp"22 .text23.Ltext0:24 .globl main25 .type main, @function26main:27.LFB0:28 .file 1 "main.cpp"29 .loc 1 1 1230 .cfi_startproc31 pushq %rbp32 .cfi_def_cfa_offset 1633 .cfi_offset 6, -1634 movq %rsp, %rbp35 .cfi_def_cfa_register 636 .loc 1 2 1037 movl $0, %eax38 .loc 1 3 139 popq %rbp40 .cfi_def_cfa 7, 841 ret42 .cfi_endproc43.LFE0:44 .size main, .-main45.Letext0:46 .section .debug_info,"",@progbits47.Ldebug_info0:48 .long 0x5049 .value 0x550 .byte 0x151 .byte 0x852 .long .Ldebug_abbrev053 .uleb128 0x154 .long .LASF055 .byte 0x2156 .long .LASF157 .long .LASF258 .quad .Ltext059 .quad .Letext0-.Ltext060 .long .Ldebug_line061 .uleb128 0x262 .long .LASF363 .byte 0x164 .byte 0x165 .byte 0x566 .long 0x4c67 .quad .LFB068 .quad .LFE0-.LFB069 .uleb128 0x170 .byte 0x9c71 .uleb128 0x372 .byte 0x473 .byte 0x574 .string "int"75 .byte 076 .section .debug_abbrev,"",@progbits77.Ldebug_abbrev0:78 .uleb128 0x179 .uleb128 0x1180 .byte 0x181 .uleb128 0x2582 .uleb128 0xe83 .uleb128 0x1384 .uleb128 0xb85 .uleb128 0x386 .uleb128 0xe87 .uleb128 0x1b88 .uleb128 0xe89 .uleb128 0x1190 .uleb128 0x191 .uleb128 0x1292 .uleb128 0x793 .uleb128 0x1094 .uleb128 0x1795 .byte 096 .byte 097 .uleb128 0x298 .uleb128 0x2e99 .byte 0100 .uleb128 0x3f101 .uleb128 0x19102 .uleb128 0x3103 .uleb128 0xe104 .uleb128 0x3a105 .uleb128 0xb106 .uleb128 0x3b107 .uleb128 0xb108 .uleb128 0x39109 .uleb128 0xb110 .uleb128 0x49111 .uleb128 0x13112 .uleb128 0x11113 .uleb128 0x1114 .uleb128 0x12115 .uleb128 0x7116 .uleb128 0x40117 .uleb128 0x18118 .uleb128 0x7a119 .uleb128 0x19120 .byte 0121 .byte 0122 .uleb128 0x3123 .uleb128 0x24124 .byte 0125 .uleb128 0xb126 .uleb128 0xb127 .uleb128 0x3e128 .uleb128 0xb129 .uleb128 0x3130 .uleb128 0x8131 .byte 0132 .byte 0133 .byte 0134 .section .debug_aranges,"",@progbits135 .long 0x2c136 .value 0x2137 .long .Ldebug_info0138 .byte 0x8139 .byte 0140 .value 0141 .value 0142 .quad .Ltext0143 .quad .Letext0-.Ltext0144 .quad 0145 .quad 0146 .section .debug_line,"",@progbits147.Ldebug_line0:148 .section .debug_str,"MS",@progbits,1149.LASF0:150 .string "GNU C++14 8.5.0 20210514 (Red Hat 8.5.0-3) -mtune=generic -march=x86-64 -g2 -gdwarf-5"151.LASF1:152 .string "main.cpp"153.LASF3:154 .string "main"155.LASF2:156 .string "."157 .ident "GCC: (GNU) 8.5.0 20210514 (Red Hat 8.5.0-3)"158 .section .note.GNU-stack,"",@progbits159