xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/XCOFF/basic.test (revision 6aa94c64a532237674433713a70ec2bda57b4fed)
1# RUN: llvm-dwarfdump --all %p/Inputs/basic32.o | FileCheck %s --check-prefix=DWARF32
2# RUN: llvm-dwarfdump --all %p/Inputs/basic64.o | FileCheck %s --check-prefix=DWARF64
3
4## basic32.o Compiled with IBM XL C/C++ for AIX, V16.1.1.0
5## Compiler command: xlc basic.c -c -qdbgfmt=dwarf -g -q32 -o basic32.o
6##
7## basic64.o Compiled with IBM XL C/C++ for AIX, V16.1.1.0
8## Compiler command: xlc basic.c -c -qdbgfmt=dwarf -g -q64 -o basic64.o
9##
10## basic.c:
11## int main(void)
12## {
13##   return 0;
14## }
15
16# DWARF32:      .debug_abbrev contents:
17# DWARF32-NEXT:  Abbrev table for offset: 0x00000000
18# DWARF32-NEXT:  [1] DW_TAG_compile_unit DW_CHILDREN_yes
19# DWARF32-NEXT:          DW_AT_name      DW_FORM_string
20# DWARF32-NEXT:          DW_AT_stmt_list DW_FORM_data4
21# DWARF32-NEXT:          DW_AT_low_pc    DW_FORM_addr
22# DWARF32-NEXT:          DW_AT_high_pc   DW_FORM_addr
23# DWARF32-NEXT:          DW_AT_language  DW_FORM_data1
24# DWARF32-NEXT:          DW_AT_comp_dir  DW_FORM_string
25# DWARF32-NEXT:          DW_AT_producer  DW_FORM_string
26# DWARF32:       [2] DW_TAG_base_type    DW_CHILDREN_no
27# DWARF32-NEXT:          DW_AT_name      DW_FORM_string
28# DWARF32-NEXT:          DW_AT_byte_size DW_FORM_data1
29# DWARF32-NEXT:          DW_AT_encoding  DW_FORM_data1
30# DWARF32:       [3] DW_TAG_const_type   DW_CHILDREN_no
31# DWARF32-NEXT:          DW_AT_type      DW_FORM_ref4
32# DWARF32:       [4] DW_TAG_array_type   DW_CHILDREN_yes
33# DWARF32-NEXT:          DW_AT_sibling   DW_FORM_ref4
34# DWARF32-NEXT:          DW_AT_type      DW_FORM_ref4
35# DWARF32:       [5] DW_TAG_subrange_type        DW_CHILDREN_no
36# DWARF32-NEXT:          DW_AT_lower_bound       DW_FORM_data1
37# DWARF32-NEXT:          DW_AT_upper_bound       DW_FORM_data1
38# DWARF32:       [6] DW_TAG_subprogram   DW_CHILDREN_yes
39# DWARF32-NEXT:          DW_AT_name      DW_FORM_string
40# DWARF32-NEXT:          DW_AT_low_pc    DW_FORM_addr
41# DWARF32-NEXT:          DW_AT_high_pc   DW_FORM_addr
42# DWARF32-NEXT:          DW_AT_prototyped        DW_FORM_flag
43# DWARF32-NEXT:          DW_AT_calling_convention        DW_FORM_data1
44# DWARF32-NEXT:          DW_AT_decl_file DW_FORM_data1
45# DWARF32-NEXT:          DW_AT_decl_line DW_FORM_data1
46# DWARF32-NEXT:          DW_AT_external  DW_FORM_flag
47# DWARF32-NEXT:          DW_AT_frame_base        DW_FORM_block1
48# DWARF32-NEXT:          DW_AT_type      DW_FORM_ref4
49# DWARF32:       [7] DW_TAG_variable     DW_CHILDREN_no
50# DWARF32-NEXT:          DW_AT_location  DW_FORM_block1
51# DWARF32-NEXT:          DW_AT_name      DW_FORM_string
52# DWARF32-NEXT:          DW_AT_decl_file DW_FORM_data1
53# DWARF32-NEXT:          DW_AT_decl_line DW_FORM_data1
54# DWARF32-NEXT:          DW_AT_type      DW_FORM_ref4
55# DWARF32:       .debug_info contents:
56# DWARF32-NEXT:  0x00000000: Compile Unit: length = 0x00000094, format = DWARF32, version = 0x0003, abbr_offset = 0x0000, addr_size = 0x04 (next unit at 0x00000098)
57# DWARF32:       0x0000000b: DW_TAG_compile_unit
58# DWARF32:                DW_AT_name        ("basic.c")
59# DWARF32-NEXT:                DW_AT_stmt_list   (0x00000000)
60# DWARF32-NEXT:                DW_AT_low_pc      (0x00000000)
61# DWARF32-NEXT:                DW_AT_high_pc     (0x00000080)
62# DWARF32-NEXT:                DW_AT_language    (DW_LANG_C89)
63# DWARF32-NEXT:                DW_AT_comp_dir    ("/")
64# DWARF32-NEXT:                DW_AT_producer    ("IBM XL C for AIX, Version 16.1.1.0")
65# DWARF32:       0x00000046:   DW_TAG_base_type
66# DWARF32-NEXT:                  DW_AT_name      ("char")
67# DWARF32-NEXT:                  DW_AT_byte_size (0x01)
68# DWARF32-NEXT:                  DW_AT_encoding  (DW_ATE_unsigned_char)
69# DWARF32:       0x0000004e:   DW_TAG_base_type
70# DWARF32-NEXT:                  DW_AT_name      ("int")
71# DWARF32-NEXT:                  DW_AT_byte_size (0x04)
72# DWARF32-NEXT:                  DW_AT_encoding  (DW_ATE_signed)
73# DWARF32:       0x00000055:   DW_TAG_const_type
74# DWARF32-NEXT:                  DW_AT_type      (0x00000046 "char")
75# DWARF32:       0x0000005a:   DW_TAG_array_type
76# DWARF32-NEXT:                  DW_AT_sibling   (0x00000067)
77# DWARF32-NEXT:                  DW_AT_type      (0x00000055 "const char")
78# DWARF32:       0x00000063:     DW_TAG_subrange_type
79# DWARF32-NEXT:                    DW_AT_lower_bound     (0x00)
80# DWARF32-NEXT:                    DW_AT_upper_bound     (0x04)
81# DWARF32:       0x00000066:     NULL
82# DWARF32:       0x00000067:   DW_TAG_subprogram
83# DWARF32-NEXT:                  DW_AT_name      ("main")
84# DWARF32-NEXT:                  DW_AT_low_pc    (0x00000000)
85# DWARF32-NEXT:                  DW_AT_high_pc   (0x00000024)
86# DWARF32-NEXT:                  DW_AT_prototyped        (0x01)
87# DWARF32-NEXT:                  DW_AT_calling_convention        (DW_CC_program)
88# DWARF32-NEXT:                  DW_AT_decl_file ("/basic.c")
89# DWARF32-NEXT:                  DW_AT_decl_line (1)
90# DWARF32-NEXT:                  DW_AT_external  (0x01)
91# DWARF32-NEXT:                  DW_AT_frame_base        (DW_OP_reg1 R1)
92# DWARF32-NEXT:                  DW_AT_type      (0x0000004e "int")
93# DWARF32:       0x00000080:     DW_TAG_variable
94# DWARF32-NEXT:                    DW_AT_location        (DW_OP_addr 0x0)
95# DWARF32-NEXT:                    DW_AT_name    ("__func__")
96# DWARF32-NEXT:                    DW_AT_decl_file       ("/basic.c")
97# DWARF32-NEXT:                    DW_AT_decl_line       (0)
98# DWARF32-NEXT:                    DW_AT_type    (0x0000005a "const char[5]")
99# DWARF32:       0x00000096:     NULL
100# DWARF32:       0x00000097:   NULL
101# DWARF32:       .debug_line contents:
102# DWARF32-NEXT:  debug_line[0x00000000]
103# DWARF32-NEXT:  Line table prologue:
104# DWARF32-NEXT:      total_length: 0x00000042
105# DWARF32-NEXT:            format: DWARF32
106# DWARF32-NEXT:           version: 3
107# DWARF32-NEXT:   prologue_length: 0x0000001e
108# DWARF32-NEXT:   min_inst_length: 1
109# DWARF32-NEXT:   default_is_stmt: 1
110# DWARF32-NEXT:         line_base: -100
111# DWARF32-NEXT:        line_range: 220
112# DWARF32-NEXT:       opcode_base: 13
113# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_copy] = 0
114# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_advance_pc] = 1
115# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_advance_line] = 1
116# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_set_file] = 1
117# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_set_column] = 1
118# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_negate_stmt] = 0
119# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_set_basic_block] = 0
120# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_const_add_pc] = 0
121# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
122# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
123# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
124# DWARF32-NEXT:  standard_opcode_lengths[DW_LNS_set_isa] = 1
125# DWARF32-NEXT:  file_names[  1]:
126# DWARF32-NEXT:             name: "basic.c"
127# DWARF32-NEXT:        dir_index: 0
128# DWARF32-NEXT:         mod_time: 0x00000000
129# DWARF32-NEXT:           length: 0x00000000
130# DWARF32:       Address            Line   Column File   ISA Discriminator OpIndex Flags
131# DWARF32-NEXT:  ------------------ ------ ------ ------ --- ------------- ------- -------------
132# DWARF32-NEXT:  0x0000000000000000      1      0      1   0             0       0  is_stmt
133# DWARF32-NEXT:  0x0000000000000004      3      0      1   0             0       0  is_stmt
134# DWARF32-NEXT:  0x0000000000000008      4      0      1   0             0       0  is_stmt
135# DWARF32-NEXT:  0x0000000000000080      4      0      1   0             0       0  is_stmt end_sequence
136# DWARF32:      .debug_pubnames contents:
137# DWARF32-NEXT:  length = 0x00000017, format = DWARF32, version = 0x0002, unit_offset = 0x00000000, unit_size = 0x00000098
138# DWARF32-NEXT:  Offset     Name
139# DWARF32-NEXT:  0x00000067 "main"
140# DWARF32:       .debug_pubtypes contents:
141# DWARF32-NEXT:  length = 0x0000001f, format = DWARF32, version = 0x0002, unit_offset = 0x00000000, unit_size = 0x00000098
142# DWARF32-NEXT:  Offset     Name
143# DWARF32-NEXT:  0x0000004e "int"
144# DWARF32-NEXT:  0x00000046 "char"
145
146# DWARF64:       .debug_abbrev contents:
147# DWARF64-NEXT:  Abbrev table for offset: 0x00000000
148# DWARF64-NEXT:  [1] DW_TAG_compile_unit DW_CHILDREN_yes
149# DWARF64-NEXT:          DW_AT_name      DW_FORM_string
150# DWARF64-NEXT:          DW_AT_stmt_list DW_FORM_data8
151# DWARF64-NEXT:          DW_AT_low_pc    DW_FORM_addr
152# DWARF64-NEXT:          DW_AT_high_pc   DW_FORM_addr
153# DWARF64-NEXT:          DW_AT_language  DW_FORM_data1
154# DWARF64-NEXT:          DW_AT_comp_dir  DW_FORM_string
155# DWARF64-NEXT:          DW_AT_producer  DW_FORM_string
156# DWARF64:       [2] DW_TAG_base_type    DW_CHILDREN_no
157# DWARF64-NEXT:          DW_AT_name      DW_FORM_string
158# DWARF64-NEXT:          DW_AT_byte_size DW_FORM_data1
159# DWARF64-NEXT:          DW_AT_encoding  DW_FORM_data1
160# DWARF64:       [3] DW_TAG_const_type   DW_CHILDREN_no
161# DWARF64-NEXT:          DW_AT_type      DW_FORM_ref8
162# DWARF64:       [4] DW_TAG_array_type   DW_CHILDREN_yes
163# DWARF64-NEXT:          DW_AT_sibling   DW_FORM_ref8
164# DWARF64-NEXT:          DW_AT_type      DW_FORM_ref8
165# DWARF64:       [5] DW_TAG_subrange_type        DW_CHILDREN_no
166# DWARF64-NEXT:          DW_AT_lower_bound       DW_FORM_data1
167# DWARF64-NEXT:          DW_AT_upper_bound       DW_FORM_data1
168# DWARF64:       [6] DW_TAG_subprogram   DW_CHILDREN_yes
169# DWARF64-NEXT:          DW_AT_name      DW_FORM_string
170# DWARF64-NEXT:          DW_AT_low_pc    DW_FORM_addr
171# DWARF64-NEXT:          DW_AT_high_pc   DW_FORM_addr
172# DWARF64-NEXT:          DW_AT_prototyped        DW_FORM_flag
173# DWARF64-NEXT:          DW_AT_calling_convention        DW_FORM_data1
174# DWARF64-NEXT:          DW_AT_decl_file DW_FORM_data1
175# DWARF64-NEXT:          DW_AT_decl_line DW_FORM_data1
176# DWARF64-NEXT:          DW_AT_external  DW_FORM_flag
177# DWARF64-NEXT:          DW_AT_frame_base        DW_FORM_block1
178# DWARF64-NEXT:          DW_AT_type      DW_FORM_ref8
179# DWARF64:       [7] DW_TAG_variable     DW_CHILDREN_no
180# DWARF64-NEXT:          DW_AT_location  DW_FORM_block1
181# DWARF64-NEXT:          DW_AT_name      DW_FORM_string
182# DWARF64-NEXT:          DW_AT_decl_file DW_FORM_data1
183# DWARF64-NEXT:          DW_AT_decl_line DW_FORM_data1
184# DWARF64-NEXT:          DW_AT_type      DW_FORM_ref8
185# DWARF64:       .debug_info contents:
186# DWARF64-NEXT:  0x00000000: Compile Unit: length = 0x00000000000000c4, format = DWARF64, version = 0x0003, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x000000d0)
187# DWARF64:       0x00000017: DW_TAG_compile_unit
188# DWARF64-NEXT:                DW_AT_name        ("basic.c")
189# DWARF64-NEXT:                DW_AT_stmt_list   (0x0000000000000000)
190# DWARF64-NEXT:                DW_AT_low_pc      (0x0000000000000000)
191# DWARF64-NEXT:                DW_AT_high_pc     (0x0000000000000080)
192# DWARF64-NEXT:                DW_AT_language    (DW_LANG_C89)
193# DWARF64-NEXT:                DW_AT_comp_dir    ("/")
194# DWARF64-NEXT:                DW_AT_producer    ("IBM XL C for AIX, Version 16.1.1.0")
195# DWARF64:       0x0000005e:   DW_TAG_base_type
196# DWARF64-NEXT:                  DW_AT_name      ("char")
197# DWARF64-NEXT:                  DW_AT_byte_size (0x01)
198# DWARF64-NEXT:                  DW_AT_encoding  (DW_ATE_unsigned_char)
199# DWARF64:       0x00000066:   DW_TAG_base_type
200# DWARF64-NEXT:                  DW_AT_name      ("int")
201# DWARF64-NEXT:                  DW_AT_byte_size (0x04)
202# DWARF64-NEXT:                  DW_AT_encoding  (DW_ATE_signed)
203# DWARF64:       0x0000006d:   DW_TAG_const_type
204# DWARF64-NEXT:                  DW_AT_type      (0x0000005e "char")
205# DWARF64:       0x00000076:   DW_TAG_array_type
206# DWARF64-NEXT:                  DW_AT_sibling   (0x0000008b)
207# DWARF64-NEXT:                  DW_AT_type      (0x0000006d "const char")
208# DWARF64:       0x00000087:     DW_TAG_subrange_type
209# DWARF64-NEXT:                    DW_AT_lower_bound     (0x00)
210# DWARF64-NEXT:                    DW_AT_upper_bound     (0x04)
211# DWARF64:       0x0000008a:     NULL
212# DWARF64:       0x0000008b:   DW_TAG_subprogram
213# DWARF64-NEXT:                  DW_AT_name      ("main")
214# DWARF64-NEXT:                  DW_AT_low_pc    (0x0000000000000000)
215# DWARF64-NEXT:                  DW_AT_high_pc   (0x0000000000000024)
216# DWARF64-NEXT:                  DW_AT_prototyped        (0x01)
217# DWARF64-NEXT:                  DW_AT_calling_convention        (DW_CC_program)
218# DWARF64-NEXT:                  DW_AT_decl_file ("/basic.c")
219# DWARF64-NEXT:                  DW_AT_decl_line (1)
220# DWARF64-NEXT:                  DW_AT_external  (0x01)
221# DWARF64-NEXT:                  DW_AT_frame_base        (DW_OP_reg1 X1)
222# DWARF64-NEXT:                  DW_AT_type      (0x00000066 "int")
223# DWARF64:       0x000000b0:     DW_TAG_variable
224# DWARF64-NEXT:                    DW_AT_location        (DW_OP_addr 0x0)
225# DWARF64-NEXT:                    DW_AT_name    ("__func__")
226# DWARF64-NEXT:                    DW_AT_decl_file       ("/basic.c")
227# DWARF64-NEXT:                    DW_AT_decl_line       (0)
228# DWARF64-NEXT:                    DW_AT_type    (0x00000076 "const char[5]")
229# DWARF64:       0x000000ce:     NULL
230# DWARF64:       0x000000cf:   NULL
231# DWARF64:       .debug_line contents:
232# DWARF64-NEXT:  debug_line[0x00000000]
233# DWARF64-NEXT:  Line table prologue:
234# DWARF64-NEXT:      total_length: 0x000000000000004a
235# DWARF64-NEXT:            format: DWARF64
236# DWARF64-NEXT:           version: 3
237# DWARF64-NEXT:   prologue_length: 0x000000000000001e
238# DWARF64-NEXT:   min_inst_length: 1
239# DWARF64-NEXT:   default_is_stmt: 1
240# DWARF64-NEXT:         line_base: -100
241# DWARF64-NEXT:        line_range: 220
242# DWARF64-NEXT:       opcode_base: 13
243# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_copy] = 0
244# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_advance_pc] = 1
245# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_advance_line] = 1
246# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_set_file] = 1
247# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_set_column] = 1
248# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_negate_stmt] = 0
249# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_set_basic_block] = 0
250# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_const_add_pc] = 0
251# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
252# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
253# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
254# DWARF64-NEXT:  standard_opcode_lengths[DW_LNS_set_isa] = 1
255# DWARF64-NEXT:  file_names[  1]:
256# DWARF64-NEXT:             name: "basic.c"
257# DWARF64-NEXT:        dir_index: 0
258# DWARF64-NEXT:         mod_time: 0x00000000
259# DWARF64-NEXT:           length: 0x00000000
260# DWARF64:       Address            Line   Column File   ISA Discriminator OpIndex Flags
261# DWARF64-NEXT:  ------------------ ------ ------ ------ --- ------------- ------- -------------
262# DWARF64-NEXT:  0x0000000000000000      1      0      1   0             0       0  is_stmt
263# DWARF64-NEXT:  0x0000000000000004      3      0      1   0             0       0  is_stmt
264# DWARF64-NEXT:  0x0000000000000008      4      0      1   0             0       0  is_stmt
265# DWARF64-NEXT:  0x0000000000000080      4      0      1   0             0       0  is_stmt end_sequence
266# DWARF64:       .debug_pubnames contents:
267# DWARF64-NEXT:  length = 0x0000000000000027, format = DWARF64, version = 0x0002, unit_offset = 0x0000000000000000, unit_size = 0x00000000000000d0
268# DWARF64-NEXT:  Offset     Name
269# DWARF64-NEXT:  0x000000000000008b "main"
270# DWARF64:       .debug_pubtypes contents:
271# DWARF64-NEXT:  length = 0x0000000000000033, format = DWARF64, version = 0x0002, unit_offset = 0x0000000000000000, unit_size = 0x00000000000000d0
272# DWARF64-NEXT:  Offset     Name
273# DWARF64-NEXT:  0x0000000000000066 "int"
274# DWARF64-NEXT:  0x000000000000005e "char"
275