aboutsummaryrefslogtreecommitdiffstats
path: root/test/tools/dsymutil/X86/basic-linking-x86.test
blob: 1059e233f94b9306e46bb72671363fbb4922b2f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
REQUIRES: shell
RUN: cat %p/../Inputs/basic.macho.x86_64 > %t1
RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t1
RUN: llvm-dwarfdump %t1.dwarf | FileCheck %s
RUN: llvm-dsymutil -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
RUN: llvm-dwarfdump %t2 | FileCheck %s
RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE

CHECK: file format Mach-O 64-bit x86-64

CHECK: debug_info contents

CHECK:  Compile Unit:

CHECK:  DW_TAG_compile_unit [1] *
CHECK:    DW_AT_producer [DW_FORM_strp]     ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK:    DW_AT_language [DW_FORM_data2]	(DW_LANG_C99)
CHECK:    DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000040] = "basic1.c")
CHECK:    DW_AT_stmt_list [DW_FORM_data4]   (0x00000000)
CHECK:    DW_AT_comp_dir [DW_FORM_strp]     ( .debug_str[0x00000049] = "/Inputs")
CHECK:    DW_AT_low_pc [DW_FORM_addr]       (0x0000000100000ea0)
CHECK:    DW_TAG_subprogram [2] *
CHECK:    DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000051] = "main")
CHECK:      DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
CHECK:      DW_AT_decl_line [DW_FORM_data1]	(23)
CHECK:      DW_AT_prototyped [DW_FORM_flag]	(0x01)
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0063 => {0x00000063})
CHECK:      DW_AT_external [DW_FORM_flag]	(0x01)
CHECK:      DW_AT_accessibility [DW_FORM_data1]	(DW_ACCESS_public)
CHECK:      DW_AT_low_pc [DW_FORM_addr]     (0x0000000100000ea0)
CHECK:      DW_AT_high_pc [DW_FORM_addr]    (0x0000000100000ec4)
CHECK:      DW_AT_frame_base [DW_FORM_block1]	(<0x01> 56 )
CHECK:      DW_TAG_formal_parameter [3]
CHECK:        DW_AT_name [DW_FORM_strp]     ( .debug_str[0x00000056] = "argc")
CHECK:        DW_AT_decl_file [DW_FORM_data1]       ("/Inputs{{[/\\]}}basic1.c")
CHECK:        DW_AT_decl_line [DW_FORM_data1]	(23)
CHECK:        DW_AT_type [DW_FORM_ref4]     (cu + 0x0063 => {0x00000063})
CHECK:        DW_AT_location [DW_FORM_block1]	(<0x02> 91 78 )
CHECK:      DW_TAG_formal_parameter [3]
CHECK:        DW_AT_name [DW_FORM_strp]     ( .debug_str[0x0000005b] = "argv")
CHECK:        DW_AT_decl_file [DW_FORM_data1]	("/Inputs{{[/\\]}}basic1.c")
CHECK:        DW_AT_decl_line [DW_FORM_data1]	(23)
CHECK:        DW_AT_type [DW_FORM_ref4]     (cu + 0x006a => {0x0000006a})
CHECK:        DW_AT_location [DW_FORM_block1]	(<0x02> 91 70 )
CHECK:      NULL
CHECK:    DW_TAG_base_type [4]
CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000060] = "int")
CHECK:      DW_AT_encoding [DW_FORM_data1]	(DW_ATE_signed)
CHECK:      DW_AT_byte_size [DW_FORM_data1]	(0x04)
CHECK:    DW_TAG_pointer_type [5]
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x006f => {0x0000006f})
CHECK:    DW_TAG_pointer_type [5]
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0074 => {0x00000074})
CHECK:    DW_TAG_const_type [6]
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0079 => {0x00000079})
CHECK:    DW_TAG_base_type [4]
CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000064] = "char")
CHECK:      DW_AT_encoding [DW_FORM_data1]	(DW_ATE_signed_char)
CHECK:      DW_AT_byte_size [DW_FORM_data1]	(0x01)
CHECK:    NULL

CHECK:  Compile Unit:

CHECK:  DW_TAG_compile_unit [1] *
CHECK:   DW_AT_producer [DW_FORM_strp]     ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK:   DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000069] = "basic2.c")
CHECK:   DW_AT_stmt_list [DW_FORM_data4]   (0x0000003f)
CHECK:   DW_AT_comp_dir [DW_FORM_strp]     ( .debug_str[0x00000049] = "/Inputs")
CHECK:   DW_AT_low_pc [DW_FORM_addr]       (0x0000000100000ed0)
CHECK:    DW_TAG_base_type [4]
CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000060] = "int")
CHECK:    DW_TAG_variable [7]
CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000072] = "private_int")
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0026 => {0x000000a7})
CHECK:      DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
BASIC:      DW_AT_location [DW_FORM_block1] (<0x09> 03 08 10 00 00 01 00 00 00 )
ARCHIVE:    DW_AT_location [DW_FORM_block1] (<0x09> 03 04 10 00 00 01 00 00 00 )
CHECK:    DW_TAG_variable [7]
CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000007e] = "baz")
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0026 => {0x000000a7})
CHECK:      DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
CHECK:      DW_AT_location [DW_FORM_block1] (<0x09> 03 00 10 00 00 01 00 00 00 )
CHECK:    DW_TAG_subprogram [2] *
CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000082] = "foo")
CHECK:      DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0026 => {0x000000a7})
CHECK:      DW_AT_low_pc [DW_FORM_addr]     (0x0000000100000ed0)
CHECK:      DW_AT_high_pc [DW_FORM_addr]    (0x0000000100000f19)
CHECK:      DW_AT_frame_base [DW_FORM_block1]	(<0x01> 56 )
CHECK:      DW_TAG_formal_parameter [3]
CHECK:        DW_AT_name [DW_FORM_strp]     ( .debug_str[0x00000086] = "arg")
CHECK:        DW_AT_type [DW_FORM_ref4]     (cu + 0x0026 => {0x000000a7})
CHECK:        DW_AT_location [DW_FORM_block1]	(<0x02> 91 7c )
CHECK:      NULL
CHECK:    DW_TAG_subprogram [8]
CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000008a] = "inc")
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0026 => {0x000000a7})
CHECK:      DW_AT_low_pc [DW_FORM_addr]     (0x0000000100000f20)
CHECK:      DW_AT_high_pc [DW_FORM_addr]    (0x0000000100000f37)
CHECK:      DW_AT_frame_base [DW_FORM_block1]	(<0x01> 56 )
CHECK:    NULL

CHECK:  Compile Unit:

CHECK:  DW_TAG_compile_unit [1] *
CHECK:    DW_AT_producer [DW_FORM_strp]     ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
CHECK:    DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008e] = "basic3.c")
CHECK:    DW_AT_stmt_list [DW_FORM_data4]   (0x00000093)
CHECK:    DW_AT_comp_dir [DW_FORM_strp]     ( .debug_str[0x00000049] = "/Inputs")
CHECK:    DW_AT_low_pc [DW_FORM_addr]       (0x0000000100000f40)
CHECK:    DW_TAG_variable [9]
CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000097] = "val")
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x003c => {0x00000162})
CHECK:      DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic3.c")
BASIC:      DW_AT_location [DW_FORM_block1] (<0x09> 03 04 10 00 00 01 00 00 00 )
ARCHIVE:    DW_AT_location [DW_FORM_block1] (<0x09> 03 08 10 00 00 01 00 00 00 )
CHECK:    DW_TAG_volatile_type [10]
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0041 => {0x00000167})
CHECK:    DW_TAG_base_type [4]
CHACK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000060] = "int")
CHECK:    DW_TAG_subprogram [2] *
CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000009b] = "bar")
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0041 => {0x00000167})
CHECK:      DW_AT_low_pc [DW_FORM_addr]     (0x0000000100000f40)
CHECK:      DW_AT_high_pc [DW_FORM_addr]    (0x0000000100000f84)
CHECK:      DW_AT_frame_base [DW_FORM_block1]	(<0x01> 56 )
CHECK:      DW_TAG_formal_parameter [3]
CHECK:        DW_AT_name [DW_FORM_strp]     ( .debug_str[0x00000086] = "arg")
CHECK:        DW_AT_type [DW_FORM_ref4]     (cu + 0x0041 => {0x00000167})
CHECK:        DW_AT_location [DW_FORM_block1]	(<0x02> 91 78 )
CHECK:      NULL
CHECK:    DW_TAG_subprogram [8]
CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000008a] = "inc")
CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0041 => {0x00000167})
CHECK:      DW_AT_low_pc [DW_FORM_addr]     (0x0000000100000f90)
CHECK:      DW_AT_high_pc [DW_FORM_addr]    (0x0000000100000fa9)
CHECK:      DW_AT_frame_base [DW_FORM_block1]	(<0x01> 56 )

CHECK:    NULL

CHECK: .debug_loc contents
CHECK-NOT: Location

CHECK:.debug_aranges contents:
CHECK-NEXT:Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
CHECK-NEXT:[0x0000000100000ea0 - 0x0000000100000ec4)
CHECK-NEXT:Address Range Header: length = 0x0000003c, version = 0x0002, cu_offset = 0x00000081, addr_size = 0x08, seg_size = 0x00
CHECK-NEXT:[0x0000000100000ed0 - 0x0000000100000f19)
CHECK-NEXT:[0x0000000100000f20 - 0x0000000100000f37)
CHECK-NEXT:Address Range Header: length = 0x0000003c, version = 0x0002, cu_offset = 0x00000126, addr_size = 0x08, seg_size = 0x00
CHECK-NEXT:[0x0000000100000f40 - 0x0000000100000f84)
CHECK-NEXT:[0x0000000100000f90 - 0x0000000100000fa9)

CHECK: .debug_line contents:
CHECK:                Dir  Mod Time   File Len   File Name
CHECK-NEXT:                 ---- ---------- ---------- ---------------------------
CHECK-NEXT: file_names[  1]    0 0x00000000 0x00000000 basic1.c
CHECK: Address            Line   Column File   ISA Discriminator Flags
CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
CHECK-NEXT: 0x0000000100000ea0     23      0      1   0             0  is_stmt
CHECK-NEXT: 0x0000000100000eb6     24      0      1   0             0  is_stmt prologue_end
CHECK-NEXT: 0x0000000100000ec4     24      0      1   0             0  is_stmt end_sequence

CHECK:                 Dir  Mod Time   File Len   File Name
CHECK-NEXT:                 ---- ---------- ---------- ---------------------------
CHECK-NEXT: file_names[  1]    0 0x00000000 0x00000000 basic2.c
CHECK: Address            Line   Column File   ISA Discriminator Flags
CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
CHECK-NEXT: 0x0000000100000ed0     19      0      1   0             0  is_stmt
CHECK-NEXT: 0x0000000100000ee2     20      0      1   0             0  is_stmt prologue_end
CHECK-NEXT: 0x0000000100000f19     20      0      1   0             0  is_stmt end_sequence
CHECK-NEXT: 0x0000000100000f20     14      0      1   0             0  is_stmt
CHECK-NEXT: 0x0000000100000f24     15      0      1   0             0  is_stmt prologue_end
CHECK-NEXT: 0x0000000100000f37     15      0      1   0             0  is_stmt end_sequence

CHECK:                 Dir  Mod Time   File Len   File Name
CHECK-NEXT:                 ---- ---------- ---------- ---------------------------
CHECK-NEXT: file_names[  1]    0 0x00000000 0x00000000 basic3.c
CHECK: Address            Line   Column File   ISA Discriminator Flags
CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
CHECK-NEXT: 0x0000000100000f40     16      0      1   0             0  is_stmt
CHECK-NEXT: 0x0000000100000f4b     17      0      1   0             0  is_stmt prologue_end
CHECK-NEXT: 0x0000000100000f58     18      0      1   0             0  is_stmt
CHECK-NEXT: 0x0000000100000f6c     19      0      1   0             0  is_stmt
CHECK-NEXT: 0x0000000100000f7b     20      0      1   0             0  is_stmt
CHECK-NEXT: 0x0000000100000f84     20      0      1   0             0  is_stmt end_sequence
CHECK-NEXT: 0x0000000100000f90     11      0      1   0             0  is_stmt
CHECK-NEXT: 0x0000000100000f9b     12      0      1   0             0  is_stmt prologue_end
CHECK-NEXT: 0x0000000100000fa9     12      0      1   0             0  is_stmt end_sequence

CHECK: .debug_pubnames contents:
CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
CHECK-NEXT: Offset     Name
CHECK-NEXT: 0x00000026 "main"
CHECK-NEXT: length = 0x00000036 version = 0x0002 unit_offset = 0x00000081 unit_size = 0x000000a5
CHECK-NEXT: Offset     Name
CHECK-NEXT: 0x0000002d "private_int"
CHECK-NEXT: 0x00000042 "baz"
CHECK-NEXT: 0x00000057 "foo"
CHECK-NEXT: 0x00000086 "inc"
CHECK-NEXT: length = 0x00000026 version = 0x0002 unit_offset = 0x00000126 unit_size = 0x00000096
CHECK-NEXT: Offset     Name
CHECK-NEXT: 0x00000026 "val"
CHECK-NEXT: 0x00000048 "bar"
CHECK-NEXT: 0x00000077 "inc"

CHECK: .debug_pubtypes contents:
CHECK-NEXT: length = 0x0000001f version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
CHECK-NEXT: Offset     Name
CHECK-NEXT: 0x00000063 "int"
CHECK-NEXT: 0x00000079 "char"
CHECK-NEXT: length = 0x00000016 version = 0x0002 unit_offset = 0x00000081 unit_size = 0x000000a5
CHECK-NEXT: Offset     Name
CHECK-NEXT: 0x00000026 "int"
CHECK-NEXT: length = 0x00000016 version = 0x0002 unit_offset = 0x00000126 unit_size = 0x00000096
CHECK-NEXT: Offset     Name
CHECK-NEXT: 0x00000041 "int"