1 # REQUIRES: system-linux
3 # RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
4 # RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q
5 # RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections --always-convert-to-ranges
6 # RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
7 # RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt
8 # RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
9 # RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s
11 # This tests conversion for DWARF5 ranges DW_AT_ranges [DW_FORM_sec_offset] to DW_AT_ranges [DW_FORM_rnglistx]
13 # PRECHECK: version = 0x0005
14 # PRECHECK: DW_AT_ranges [DW_FORM_sec_offset]
17 # POSTCHECK-NEXT: 0x[[#%.16x,ADDR:]]
18 # POSTCHECK-NEXT: 0x[[#%.16x,ADDR1:]]
19 # POSTCHECK: version = 0x0005
20 # POSTCHECK: DW_AT_ranges [DW_FORM_rnglistx]
21 # POSTCHECK-SAME: (indexed (0x0) rangelist = 0x00000018
22 # POSTCHECK-NEXT: [0x[[#ADDR]], 0x[[#ADDR + 11]]
23 # POSTCHECK-NEXT: [0x[[#ADDR1]], 0x[[#ADDR1 + 11]]
24 # POSTCHECK-NEXT: DW_AT_low_pc [DW_FORM_addr]
25 # POSTCHECK-NEXT: DW_AT_stmt_list [DW_FORM_sec_offset]
26 # POSTCHECK-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c)
27 # POSTCHECK-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
41 .file 0 "/testRangeOffsetToRangeX" "main.cpp"
42 .section .text._Z3foov,"ax",@progbits
44 .type _Z3foov, @function
51 .cfi_def_cfa_offset 16
54 .cfi_def_cfa_register 6
63 .size _Z3foov, .-_Z3foov
64 .section .text.main,"ax",@progbits
72 .cfi_def_cfa_offset 16
75 .cfi_def_cfa_register 6
89 .section .debug_info,"",@progbits
130 .section .debug_abbrev,"",@progbits
215 .section .debug_aranges,"",@progbits
229 .section .debug_rnglists,"",@progbits
231 .long .Ldebug_ranges3-.Ldebug_ranges2
246 .section .debug_line,"",@progbits
248 .section .debug_str,"MS",@progbits,1
254 .string "GNU C++17 11.x"
255 .section .debug_line_str,"MS",@progbits,1
259 .string "/testRangeOffsetToRangeX"
260 .ident "GCC: (GNU) 11.x"
261 .section .note.GNU-stack,"",@progbits