1 # RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t
2 # RUN: llvm-dwarfdump -v %t 2>%t.err | FileCheck %s
3 # RUN: FileCheck %s <%t.err -check-prefix=ERR
5 # CHECK: .debug_info contents:
6 # CHECK: 0x0000000b: DW_TAG_compile_unit [1]
7 # CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000 ".text")
8 # CHECK-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000
9 # CHECK-NEXT: [0x0000000000000000, 0x0000000000000001) ".text"
10 # CHECK-NEXT: [0x0000000000000003, 0x0000000000000006) ".text"
11 # CHECK-NEXT: [0x0000000000000001, 0x0000000000000002) ".text.foo1")
28 .section .text.foo1,"ax",@progbits
35 .section .debug_abbrev,"",@progbits
36 .byte 1 # Abbreviation Code
37 .byte 17 # DW_TAG_compile_unit
38 .byte 0 # DW_CHILDREN_no
39 .byte 37 # DW_AT_producer
40 .byte 14 # DW_FORM_strp
41 .byte 19 # DW_AT_language
42 .byte 5 # DW_FORM_data2
44 .byte 14 # DW_FORM_strp
45 .byte 16 # DW_AT_stmt_list
46 .byte 23 # DW_FORM_sec_offset
47 .byte 27 # DW_AT_comp_dir
48 .byte 14 # DW_FORM_strp
49 .byte 17 # DW_AT_low_pc
50 .byte 1 # DW_FORM_addr
51 .byte 85 # DW_AT_ranges
52 .byte 23 # DW_FORM_sec_offset
57 .section .debug_info,"",@progbits
59 .long 38 # Length of Unit
60 .short 4 # DWARF version number
61 .long .debug_abbrev # Offset Into Abbrev. Section
62 .byte 8 # Address Size (in bytes)
63 .byte 1 # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
64 .long 0 # DW_AT_producer
65 .short 4 # DW_AT_language
67 .long 0 # DW_AT_stmt_list
68 .long 0 # DW_AT_comp_dir
69 .quad .Lfunc_begin0 # DW_AT_low_pc
70 .long .Ldebug_ranges0 # DW_AT_ranges
72 # A CU with an invalid DW_AT_ranges attribute
74 .long 38 # Length of Unit
75 .short 4 # DWARF version number
76 .long .debug_abbrev # Offset Into Abbrev. Section
77 .byte 8 # Address Size (in bytes)
78 .byte 1 # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
79 .long 0 # DW_AT_producer
80 .short 4 # DW_AT_language
82 .long 0 # DW_AT_stmt_list
83 .long 0 # DW_AT_comp_dir
84 .quad .Lfunc_begin0 # DW_AT_low_pc
85 .long 0x4000 # DW_AT_ranges
87 # ERR: error: decoding address ranges: invalid range list offset 0x4000
89 # A CU where the DW_AT_ranges attribute points to an invalid range list.
91 .long 38 # Length of Unit
92 .short 4 # DWARF version number
93 .long .debug_abbrev # Offset Into Abbrev. Section
94 .byte 8 # Address Size (in bytes)
95 .byte 1 # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
96 .long 0 # DW_AT_producer
97 .short 4 # DW_AT_language
99 .long 0 # DW_AT_stmt_list
100 .long 0 # DW_AT_comp_dir
101 .quad .Lfunc_begin0 # DW_AT_low_pc
102 .long .Ldebug_ranges1 # DW_AT_ranges
104 .section .debug_ranges,"",@progbits
106 .quad .Lfunc_begin0-.Lfunc_begin0
107 .quad .Ltmp0-.Lfunc_begin0
108 .quad .Ltmp1-.Lfunc_begin0
109 .quad .Ltmp2-.Lfunc_begin0
110 .quad 0xFFFFFFFFFFFFFFFF
112 .quad .Ltmp4-.text.foo1
113 .quad .Ltmp5-.text.foo1
119 # ERR: error: decoding address ranges: invalid range list entry at offset 0x50