2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3 # RUN: ld.lld --gdb-index -e main %t.o -o %t
4 # RUN: llvm-dwarfdump -gdb-index %t | FileCheck %s
6 # CHECK: .gdb_index contents:
7 # CHECK: Address area offset = 0x28, has 1 entries:
8 # CHECK-NEXT: Low/High address = [0x201120, 0x201121) (Size: 0x1), CU id = 0
10 ## .debug_ranges contains 2 entries. .Lfunc_end0 is defined in the discarded
11 ## .text.foo. Test we resolve it to a non-zero value, otherwise the address area
12 ## of .gdb_index will not included [.Lfunc_begin1, .Lfunc_end1).
14 .section .text.foo,"aex",@progbits
19 .section .text.bar,"ax",@progbits
24 .section .debug_abbrev,"",@progbits
25 .byte 1 # Abbreviation Code
26 .byte 17 # DW_TAG_compile_unit
27 .byte 0 # DW_CHILDREN_no
28 .byte 85 # DW_AT_ranges
29 .byte 23 # DW_FORM_sec_offset
34 .section .debug_info,"",@progbits
36 .long .Lcu_end0 - .Lcu_begin0 - 4
37 .short 4 # DWARF version number
38 .long 0 # Offset Into Abbrev. Section
39 .byte 8 # Address Size
41 .byte 1 # Abbrev [1] DW_TAG_compile_unit
42 .long 0 # DW_AT_ranges
45 .section .debug_ranges,"",@progbits