1 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t
2 # RUN: llvm-dwarfdump %t | FileCheck %s
4 # CHECK: DW_AT_name ("x0")
5 # CHECK-NEXT: DW_AT_location (0x0000000c
6 # CHECK-NEXT: [0x0000000000000000, 0x0000000000000002): DW_OP_reg5 RDI
7 # CHECK-NEXT: [0x0000000000000002, 0x0000000000000003): DW_OP_reg0 RAX)
9 # CHECK: DW_AT_name ("x1")
10 # CHECK-NEXT: DW_AT_location (0xdeadbeef
11 # CHECK-NEXT: error extracting location list: unexpected end of data)
13 # CHECK: DW_AT_name ("x2")
14 # CHECK-NEXT: DW_AT_location (0x00000025
15 # CHECK-NEXT: error extracting location list: unexpected end of data)
26 .size f, .Lfunc_end0-f
28 .section .debug_str,"MS",@progbits,1
30 .asciz "Hand-written DWARF"
42 .section .debug_loclists,"",@progbits
43 .long .Ldebug_loclist_table_end0-.Ldebug_loclist_table_start0 # Length
44 .Ldebug_loclist_table_start0:
46 .byte 8 # Address size
47 .byte 0 # Segment selector size
48 .long 0 # Offset entry count
49 .Lloclists_table_base0:
51 .byte 8 # DW_LLE_start_length
52 .quad .Lfunc_begin0-.Lfunc_begin0 # starting offset
53 .uleb128 .Ltmp0-.Lfunc_begin0 # size
54 .byte 1 # Loc expr size
55 .byte 85 # super-register DW_OP_reg5
56 .byte 8 # DW_LLE_start_length
57 .quad .Ltmp0-.Lfunc_begin0 # starting offset
58 .uleb128 .Lfunc_end0-.Ltmp0 # size
59 .byte 1 # Loc expr size
60 .byte 80 # super-register DW_OP_reg0
61 .byte 0 # DW_LLE_end_of_list
63 .byte 8 # DW_LLE_start_length
64 .quad .Lfunc_begin0-.Lfunc_begin0 # starting offset
65 .uleb128 .Ltmp0-.Lfunc_begin0 # size
66 .uleb128 0xdeadbeef # Loc expr size
67 .Ldebug_loclist_table_end0:
69 .section .debug_abbrev,"",@progbits
70 .byte 1 # Abbreviation Code
71 .byte 17 # DW_TAG_compile_unit
72 .byte 1 # DW_CHILDREN_yes
73 .byte 37 # DW_AT_producer
74 .byte 14 # DW_FORM_strp
75 .byte 19 # DW_AT_language
76 .byte 5 # DW_FORM_data2
79 .byte 2 # Abbreviation Code
80 .byte 46 # DW_TAG_subprogram
81 .byte 1 # DW_CHILDREN_yes
83 .byte 14 # DW_FORM_strp
86 .byte 3 # Abbreviation Code
87 .byte 5 # DW_TAG_formal_parameter
88 .byte 0 # DW_CHILDREN_no
90 .byte 14 # DW_FORM_strp
91 .byte 2 # DW_AT_location
92 .byte 23 # DW_FORM_sec_offset
95 .byte 4 # Abbreviation Code
96 .byte 36 # DW_TAG_base_type
97 .byte 0 # DW_CHILDREN_no
99 .byte 14 # DW_FORM_strp
100 .byte 62 # DW_AT_encoding
101 .byte 11 # DW_FORM_data1
102 .byte 11 # DW_AT_byte_size
103 .byte 11 # DW_FORM_data1
108 .section .debug_info,"",@progbits
110 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
112 .short 5 # DWARF version number
113 .byte 1 # DWARF Unit Type
114 .byte 8 # Address Size (in bytes)
115 .long .debug_abbrev # Offset Into Abbrev. Section
116 .byte 1 # Abbrev [1] 0xb:0x50 DW_TAG_compile_unit
117 .long .Linfo_string0 # DW_AT_producer
118 .short 12 # DW_AT_language
119 .byte 2 # Abbrev [2] 0x2a:0x29 DW_TAG_subprogram
120 .long .Linfo_string3 # DW_AT_name
121 .byte 3 # Abbrev [3] DW_TAG_formal_parameter
122 .long .Lx0 # DW_AT_name
123 .long .Ldebug_loc0 # DW_AT_location
124 .byte 3 # Abbrev [3] DW_TAG_formal_parameter
125 .long .Lx1 # DW_AT_name
126 .long 0xdeadbeef # DW_AT_location
127 .byte 3 # Abbrev [3] DW_TAG_formal_parameter
128 .long .Lx2 # DW_AT_name
129 .long .Ldebug_loc2 # DW_AT_location
130 .byte 0 # End Of Children Mark
131 .byte 0 # End Of Children Mark