1 # RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t
2 # RUN: llvm-dwarfdump -v %t | FileCheck %s
4 # CHECK: .debug_info contents:
5 # CHECK: DW_TAG_compile_unit
6 # CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000
7 # CHECK-NEXT: [0x0000000000000000, 0x0000000000000001) ".text.foo1"
8 # CHECK-NEXT: [0x0000000000000000, 0x0000000000000002) ".text.foo2" [4]
9 # CHECK-NEXT: [0x0000000000000000, 0x0000000000000003) ".text.foo2" [5])
11 # CHECK: .debug_ranges contents:
12 # CHECK: 00000000 0000000000000000 0000000000000001
13 # CHECK: 00000000 0000000000000000 0000000000000002
14 # CHECK: 00000000 0000000000000000 0000000000000003
15 # CHECK: 00000000 <End of list>
17 # RUN: llvm-dwarfdump %t | FileCheck %s --check-prefix=BRIEF
18 # BRIEF: DW_TAG_compile_unit
19 # BRIEF: DW_AT_ranges (0x00000000
20 # BRIEF-NEXT: [0x0000000000000000, 0x0000000000000001)
21 # BRIEF-NEXT: [0x0000000000000000, 0x0000000000000002)
22 # BRIEF-NEXT: [0x0000000000000000, 0x0000000000000003))
24 # RUN: llvm-dwarfdump -diff %t | FileCheck %s --check-prefix=DIFF
25 # DIFF: DW_TAG_compile_unit
26 # DIFF-NEXT: DW_AT_producer ()
27 # DIFF-NEXT: DW_AT_language (DW_LANG_C_plus_plus)
28 # DIFF-NEXT: DW_AT_name ()
29 # DIFF-NEXT: DW_AT_stmt_list ()
30 # DIFF-NEXT: DW_AT_comp_dir ()
31 # DIFF-NEXT: DW_AT_low_pc ()
32 # DIFF-NEXT: DW_AT_ranges ()
34 ## Asm code for testcase is a reduced and modified output from next
35 ## invocation and source:
36 # clang test.cpp -S -o test.s -gmlt -ffunction-sections
41 .section .text.foo1,"ax",@progbits
46 .section .text.foo2,"ax",@progbits, unique, 1
52 .section .text.foo2,"ax",@progbits, unique, 2
59 .section .debug_abbrev,"",@progbits
60 .byte 1 # Abbreviation Code
61 .byte 17 # DW_TAG_compile_unit
62 .byte 0 # DW_CHILDREN_no
63 .byte 37 # DW_AT_producer
64 .byte 14 # DW_FORM_strp
65 .byte 19 # DW_AT_language
66 .byte 5 # DW_FORM_data2
68 .byte 14 # DW_FORM_strp
69 .byte 16 # DW_AT_stmt_list
70 .byte 23 # DW_FORM_sec_offset
71 .byte 27 # DW_AT_comp_dir
72 .byte 14 # DW_FORM_strp
73 .byte 17 # DW_AT_low_pc
74 .byte 1 # DW_FORM_addr
75 .byte 85 # DW_AT_ranges
76 .byte 23 # DW_FORM_sec_offset
81 .section .debug_info,"",@progbits
83 .long 38 # Length of Unit
84 .short 4 # DWARF version number
85 .long .debug_abbrev # Offset Into Abbrev. Section
86 .byte 8 # Address Size (in bytes)
87 .byte 1 # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
88 .long 0 # DW_AT_producer
89 .short 4 # DW_AT_language
91 .long 0 # DW_AT_stmt_list
92 .long 0 # DW_AT_comp_dir
93 .quad 0 # DW_AT_low_pc
94 .long .Ldebug_ranges0 # DW_AT_ranges
96 .section .debug_ranges,"",@progbits