2 ; RUN: llc -debugger-tune=gdb -mcpu=ppc -mtriple powerpc-ibm-aix-xcoff < %s | \
5 source_filename = "2.c"
6 target datalayout = "E-m:a-p:32:32-i64:64-n32"
8 ; Function Attrs: noinline nounwind optnone
9 define i32 @bar() #0 !dbg !8 {
14 ; Function Attrs: noinline nounwind optnone
15 define i32 @main() #0 section "explicit_main_sec" !dbg !14 {
17 %retval = alloca i32, align 4
18 store i32 0, ptr %retval, align 4
19 %call = call i32 @bar(), !dbg !15
20 ret i32 %call, !dbg !16
24 !llvm.module.flags = !{!3, !4, !5, !6}
27 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 13.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
28 !1 = !DIFile(filename: "2.c", directory: "debug")
30 !3 = !{i32 7, !"Dwarf Version", i32 3}
31 !4 = !{i32 2, !"Debug Info Version", i32 3}
32 !5 = !{i32 1, !"wchar_size", i32 2}
33 !6 = !{i32 7, !"PIC Level", i32 2}
34 !7 = !{!"clang version 13.0.0"}
35 !8 = distinct !DISubprogram(name: "bar", scope: !9, file: !9, line: 1, type: !10, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
36 !9 = !DIFile(filename: "2.c", directory: "debug")
37 !10 = !DISubroutineType(types: !11)
39 !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
40 !13 = !DILocation(line: 1, column: 12, scope: !8)
41 !14 = distinct !DISubprogram(name: "main", scope: !9, file: !9, line: 2, type: !10, scopeLine: 2, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
42 !15 = !DILocation(line: 3, column: 10, scope: !14)
43 !16 = !DILocation(line: 3, column: 3, scope: !14)
46 ; CHECK-NEXT: .csect ..text..[PR],5
47 ; CHECK-NEXT: .rename ..text..[PR],""
48 ; CHECK-NEXT: .machine "COM"
49 ; CHECK-NEXT: .globl bar[DS] # -- Begin function bar
50 ; CHECK-NEXT: .globl .bar
51 ; CHECK-NEXT: .align 2
52 ; CHECK-NEXT: .csect bar[DS],2
53 ; CHECK-NEXT: .vbyte 4, .bar # @bar
54 ; CHECK-NEXT: .vbyte 4, TOC[TC0]
55 ; CHECK-NEXT: .vbyte 4, 0
56 ; CHECK-NEXT: .csect ..text..[PR],5
58 ; CHECK-NEXT: L..func_begin0:
59 ; CHECK-NEXT: # %bb.0: # %entry
60 ; CHECK-NEXT: L..tmp0:
63 ; CHECK-NEXT: L..tmp1:
64 ; CHECK-NEXT: L..bar0:
65 ; CHECK-NEXT: .vbyte 4, 0x00000000 # Traceback table begin
66 ; CHECK-NEXT: .byte 0x00 # Version = 0
67 ; CHECK-NEXT: .byte 0x09 # Language = CPlusPlus
68 ; CHECK-NEXT: .byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue
69 ; CHECK-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure
70 ; CHECK-NEXT: # -HasControlledStorage, -IsTOCless
71 ; CHECK-NEXT: # -IsFloatingPointPresent
72 ; CHECK-NEXT: # -IsFloatingPointOperationLogOrAbortEnabled
73 ; CHECK-NEXT: .byte 0x40 # -IsInterruptHandler, +IsFunctionNamePresent, -IsAllocaUsed
74 ; CHECK-NEXT: # OnConditionDirective = 0, -IsCRSaved, -IsLRSaved
75 ; CHECK-NEXT: .byte 0x00 # -IsBackChainStored, -IsFixup, NumOfFPRsSaved = 0
76 ; CHECK-NEXT: .byte 0x00 # -HasExtensionTable, -HasVectorInfo, NumOfGPRsSaved = 0
77 ; CHECK-NEXT: .byte 0x00 # NumberOfFixedParms = 0
78 ; CHECK-NEXT: .byte 0x01 # NumberOfFPParms = 0, +HasParmsOnStack
79 ; CHECK-NEXT: .vbyte 4, L..bar0-.bar # Function size
80 ; CHECK-NEXT: .vbyte 2, 0x0003 # Function name len = 3
81 ; CHECK-NEXT: .byte "bar" # Function Name
82 ; CHECK-NEXT: L..func_end0:
83 ; CHECK-NEXT: # -- End function
84 ; CHECK-NEXT: .csect explicit_main_sec[PR],5
85 ; CHECK-NEXT: .globl main[DS] # -- Begin function main
86 ; CHECK-NEXT: .globl .main
87 ; CHECK-NEXT: .align 2
88 ; CHECK-NEXT: .csect main[DS],2
89 ; CHECK-NEXT: .vbyte 4, .main # @main
90 ; CHECK-NEXT: .vbyte 4, TOC[TC0]
91 ; CHECK-NEXT: .vbyte 4, 0
92 ; CHECK-NEXT: .csect explicit_main_sec[PR],5
94 ; CHECK-NEXT: L..func_begin1:
95 ; CHECK-NEXT: # %bb.0: # %entry
96 ; CHECK-NEXT: L..tmp2:
98 ; CHECK-NEXT: stwu 1, -64(1)
100 ; CHECK-NEXT: stw 0, 72(1)
101 ; CHECK-NEXT: stw 3, 60(1)
102 ; CHECK-NEXT: L..tmp3:
103 ; CHECK-NEXT: L..tmp4:
104 ; CHECK-NEXT: bl .bar
106 ; CHECK-NEXT: L..tmp5:
107 ; CHECK-NEXT: addi 1, 1, 64
108 ; CHECK-NEXT: lwz 0, 8(1)
111 ; CHECK-NEXT: L..tmp6:
112 ; CHECK-NEXT: L..main0:
113 ; CHECK-NEXT: .vbyte 4, 0x00000000 # Traceback table begin
114 ; CHECK-NEXT: .byte 0x00 # Version = 0
115 ; CHECK-NEXT: .byte 0x09 # Language = CPlusPlus
116 ; CHECK-NEXT: .byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue
117 ; CHECK-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure
118 ; CHECK-NEXT: # -HasControlledStorage, -IsTOCless
119 ; CHECK-NEXT: # -IsFloatingPointPresent
120 ; CHECK-NEXT: # -IsFloatingPointOperationLogOrAbortEnabled
121 ; CHECK-NEXT: .byte 0x41 # -IsInterruptHandler, +IsFunctionNamePresent, -IsAllocaUsed
122 ; CHECK-NEXT: # OnConditionDirective = 0, -IsCRSaved, +IsLRSaved
123 ; CHECK-NEXT: .byte 0x80 # +IsBackChainStored, -IsFixup, NumOfFPRsSaved = 0
124 ; CHECK-NEXT: .byte 0x00 # -HasExtensionTable, -HasVectorInfo, NumOfGPRsSaved = 0
125 ; CHECK-NEXT: .byte 0x00 # NumberOfFixedParms = 0
126 ; CHECK-NEXT: .byte 0x01 # NumberOfFPParms = 0, +HasParmsOnStack
127 ; CHECK-NEXT: .vbyte 4, L..main0-.main # Function size
128 ; CHECK-NEXT: .vbyte 2, 0x0004 # Function name len = 4
129 ; CHECK-NEXT: .byte "main" # Function Name
130 ; CHECK-NEXT: L..func_end1:
131 ; CHECK-NEXT: # -- End function
132 ; CHECK-NEXT: L..sec_end0:
133 ; CHECK: .dwsect 0x60000
134 ; CHECK-NEXT: .dwabrev:
135 ; CHECK-NEXT: .byte 1 # Abbreviation Code
136 ; CHECK-NEXT: .byte 17 # DW_TAG_compile_unit
137 ; CHECK-NEXT: .byte 1 # DW_CHILDREN_yes
138 ; CHECK-NEXT: .byte 37 # DW_AT_producer
139 ; CHECK-NEXT: .byte 14 # DW_FORM_strp
140 ; CHECK-NEXT: .byte 19 # DW_AT_language
141 ; CHECK-NEXT: .byte 5 # DW_FORM_data2
142 ; CHECK-NEXT: .byte 3 # DW_AT_name
143 ; CHECK-NEXT: .byte 14 # DW_FORM_strp
144 ; CHECK-NEXT: .byte 16 # DW_AT_stmt_list
145 ; CHECK-NEXT: .byte 6 # DW_FORM_data4
146 ; CHECK-NEXT: .byte 27 # DW_AT_comp_dir
147 ; CHECK-NEXT: .byte 14 # DW_FORM_strp
148 ; CHECK-NEXT: .byte 17 # DW_AT_low_pc
149 ; CHECK-NEXT: .byte 1 # DW_FORM_addr
150 ; CHECK-NEXT: .byte 85 # DW_AT_ranges
151 ; CHECK-NEXT: .byte 6 # DW_FORM_data4
152 ; CHECK-NEXT: .byte 0 # EOM(1)
153 ; CHECK-NEXT: .byte 0 # EOM(2)
154 ; CHECK-NEXT: .byte 2 # Abbreviation Code
155 ; CHECK-NEXT: .byte 46 # DW_TAG_subprogram
156 ; CHECK-NEXT: .byte 0 # DW_CHILDREN_no
157 ; CHECK-NEXT: .byte 17 # DW_AT_low_pc
158 ; CHECK-NEXT: .byte 1 # DW_FORM_addr
159 ; CHECK-NEXT: .byte 18 # DW_AT_high_pc
160 ; CHECK-NEXT: .byte 1 # DW_FORM_addr
161 ; CHECK-NEXT: .byte 64 # DW_AT_frame_base
162 ; CHECK-NEXT: .byte 10 # DW_FORM_block1
163 ; CHECK-NEXT: .byte 3 # DW_AT_name
164 ; CHECK-NEXT: .byte 14 # DW_FORM_strp
165 ; CHECK-NEXT: .byte 58 # DW_AT_decl_file
166 ; CHECK-NEXT: .byte 11 # DW_FORM_data1
167 ; CHECK-NEXT: .byte 59 # DW_AT_decl_line
168 ; CHECK-NEXT: .byte 11 # DW_FORM_data1
169 ; CHECK-NEXT: .byte 73 # DW_AT_type
170 ; CHECK-NEXT: .byte 19 # DW_FORM_ref4
171 ; CHECK-NEXT: .byte 63 # DW_AT_external
172 ; CHECK-NEXT: .byte 12 # DW_FORM_flag
173 ; CHECK-NEXT: .byte 0 # EOM(1)
174 ; CHECK-NEXT: .byte 0 # EOM(2)
175 ; CHECK-NEXT: .byte 3 # Abbreviation Code
176 ; CHECK-NEXT: .byte 36 # DW_TAG_base_type
177 ; CHECK-NEXT: .byte 0 # DW_CHILDREN_no
178 ; CHECK-NEXT: .byte 3 # DW_AT_name
179 ; CHECK-NEXT: .byte 14 # DW_FORM_strp
180 ; CHECK-NEXT: .byte 62 # DW_AT_encoding
181 ; CHECK-NEXT: .byte 11 # DW_FORM_data1
182 ; CHECK-NEXT: .byte 11 # DW_AT_byte_size
183 ; CHECK-NEXT: .byte 11 # DW_FORM_data1
184 ; CHECK-NEXT: .byte 0 # EOM(1)
185 ; CHECK-NEXT: .byte 0 # EOM(2)
186 ; CHECK-NEXT: .byte 0 # EOM(3)
187 ; CHECK: .dwsect 0x10000
188 ; CHECK-NEXT: .dwinfo:
189 ; CHECK-NEXT: L..cu_begin0:
190 ; CHECK-NEXT: .vbyte 2, 3 # DWARF version number
191 ; CHECK-NEXT: .vbyte 4, .dwabrev # Offset Into Abbrev. Section
192 ; CHECK-NEXT: .byte 4 # Address Size (in bytes)
193 ; CHECK-NEXT: .byte 1 # Abbrev [1] 0xb:0x4f DW_TAG_compile_unit
194 ; CHECK-NEXT: .vbyte 4, L..info_string0 # DW_AT_producer
195 ; CHECK-NEXT: .vbyte 2, 12 # DW_AT_language
196 ; CHECK-NEXT: .vbyte 4, L..info_string1 # DW_AT_name
197 ; CHECK-NEXT: .vbyte 4, L..line_table_start0 # DW_AT_stmt_list
198 ; CHECK-NEXT: .vbyte 4, L..info_string2 # DW_AT_comp_dir
199 ; CHECK-NEXT: .vbyte 4, 0 # DW_AT_low_pc
200 ; CHECK-NEXT: .vbyte 4, L..debug_ranges0 # DW_AT_ranges
201 ; CHECK-NEXT: .byte 2 # Abbrev [2] 0x26:0x16 DW_TAG_subprogram
202 ; CHECK-NEXT: .vbyte 4, L..func_begin0 # DW_AT_low_pc
203 ; CHECK-NEXT: .vbyte 4, L..func_end0 # DW_AT_high_pc
204 ; CHECK-NEXT: .byte 1 # DW_AT_frame_base
205 ; CHECK-NEXT: .byte 81
206 ; CHECK-NEXT: .vbyte 4, L..info_string3 # DW_AT_name
207 ; CHECK-NEXT: .byte 1 # DW_AT_decl_file
208 ; CHECK-NEXT: .byte 1 # DW_AT_decl_line
209 ; CHECK-NEXT: .vbyte 4, 82 # DW_AT_type
210 ; CHECK-NEXT: .byte 1 # DW_AT_external
211 ; CHECK-NEXT: .byte 2 # Abbrev [2] 0x3c:0x16 DW_TAG_subprogram
212 ; CHECK-NEXT: .vbyte 4, L..func_begin1 # DW_AT_low_pc
213 ; CHECK-NEXT: .vbyte 4, L..func_end1 # DW_AT_high_pc
214 ; CHECK-NEXT: .byte 1 # DW_AT_frame_base
215 ; CHECK-NEXT: .byte 81
216 ; CHECK-NEXT: .vbyte 4, L..info_string5 # DW_AT_name
217 ; CHECK-NEXT: .byte 1 # DW_AT_decl_file
218 ; CHECK-NEXT: .byte 2 # DW_AT_decl_line
219 ; CHECK-NEXT: .vbyte 4, 82 # DW_AT_type
220 ; CHECK-NEXT: .byte 1 # DW_AT_external
221 ; CHECK-NEXT: .byte 3 # Abbrev [3] 0x52:0x7 DW_TAG_base_type
222 ; CHECK-NEXT: .vbyte 4, L..info_string4 # DW_AT_name
223 ; CHECK-NEXT: .byte 5 # DW_AT_encoding
224 ; CHECK-NEXT: .byte 4 # DW_AT_byte_size
225 ; CHECK-NEXT: .byte 0 # End Of Children Mark
226 ; CHECK-NEXT: L..debug_info_end0:
227 ; CHECK: .dwsect 0x80000
228 ; CHECK-NEXT: .dwrnges:
229 ; CHECK-NEXT: L..debug_ranges0:
230 ; CHECK-NEXT: .vbyte 4, L..func_begin0
231 ; CHECK-NEXT: .vbyte 4, L..func_end0
232 ; CHECK-NEXT: .vbyte 4, L..func_begin1
233 ; CHECK-NEXT: .vbyte 4, L..func_end1
234 ; CHECK-NEXT: .vbyte 4, 0
235 ; CHECK-NEXT: .vbyte 4, 0
236 ; CHECK: .dwsect 0x70000
237 ; CHECK-NEXT: .dwstr:
238 ; CHECK-NEXT: L..info_string0:
239 ; CHECK-NEXT: .string "clang version 13.0.0" # string offset=0
240 ; CHECK-NEXT: L..info_string1:
241 ; CHECK-NEXT: .string "2.c" # string offset=21
242 ; CHECK-NEXT: L..info_string2:
243 ; CHECK-NEXT: .string "debug" # string offset=25
244 ; CHECK-NEXT: L..info_string3:
245 ; CHECK-NEXT: .string "bar" # string offset=31
246 ; CHECK-NEXT: L..info_string4:
247 ; CHECK-NEXT: .string "int" # string offset=35
248 ; CHECK-NEXT: L..info_string5:
249 ; CHECK-NEXT: .string "main" # string offset=39
251 ; CHECK: .dwsect 0x20000
252 ; CHECK-NEXT: .dwline:
253 ; CHECK-NEXT: L..debug_line_0:
254 ; CHECK-NEXT: .set L..line_table_start0, L..debug_line_0-4
255 ; CHECK-NEXT: .vbyte 2, 3
256 ; CHECK-NEXT: .vbyte 4, L..prologue_end0-L..prologue_start0
257 ; CHECK-NEXT: L..prologue_start0:
258 ; CHECK-NEXT: .byte 4
259 ; CHECK-NEXT: .byte 1
260 ; CHECK-NEXT: .byte -5
261 ; CHECK-NEXT: .byte 14
262 ; CHECK-NEXT: .byte 13
263 ; CHECK-NEXT: .byte 0
264 ; CHECK-NEXT: .byte 1
265 ; CHECK-NEXT: .byte 1
266 ; CHECK-NEXT: .byte 1
267 ; CHECK-NEXT: .byte 1
268 ; CHECK-NEXT: .byte 0
269 ; CHECK-NEXT: .byte 0
270 ; CHECK-NEXT: .byte 0
271 ; CHECK-NEXT: .byte 1
272 ; CHECK-NEXT: .byte 0
273 ; CHECK-NEXT: .byte 0
274 ; CHECK-NEXT: .byte 1
275 ; CHECK-NEXT: .byte "debug"
276 ; CHECK-NEXT: .byte 0
277 ; CHECK-NEXT: .byte 0
278 ; CHECK-NEXT: .byte "2.c"
279 ; CHECK-NEXT: .byte 0
280 ; CHECK-NEXT: .byte 1
281 ; CHECK-NEXT: .byte 0
282 ; CHECK-NEXT: .byte 0
283 ; CHECK-NEXT: .byte 0
284 ; CHECK-NEXT: L..prologue_end0:
285 ; CHECK-NEXT: .byte 5
286 ; CHECK-NEXT: .byte 12
287 ; CHECK-NEXT: .byte 10
288 ; CHECK-NEXT: .byte 0 # Set address to L..tmp0
289 ; CHECK-NEXT: .byte 5
290 ; CHECK-NEXT: .byte 2
291 ; CHECK-NEXT: .vbyte 4, L..tmp0
292 ; CHECK-NEXT: .byte 1 # Start sequence
293 ; CHECK-NEXT: .byte 0 # Set address to L..func_end0
294 ; CHECK-NEXT: .byte 5
295 ; CHECK-NEXT: .byte 2
296 ; CHECK-NEXT: .vbyte 4, L..func_end0
297 ; CHECK-NEXT: .byte 0 # End sequence
298 ; CHECK-NEXT: .byte 1
299 ; CHECK-NEXT: .byte 1
300 ; CHECK-NEXT: .byte 0 # Set address to L..tmp2
301 ; CHECK-NEXT: .byte 5
302 ; CHECK-NEXT: .byte 2
303 ; CHECK-NEXT: .vbyte 4, L..tmp2
304 ; CHECK-NEXT: .byte 19 # Start sequence
305 ; CHECK-NEXT: .byte 5
306 ; CHECK-NEXT: .byte 10
307 ; CHECK-NEXT: .byte 10
308 ; CHECK-NEXT: .byte 0 # Set address to L..tmp4
309 ; CHECK-NEXT: .byte 5
310 ; CHECK-NEXT: .byte 2
311 ; CHECK-NEXT: .vbyte 4, L..tmp4
312 ; CHECK-NEXT: .byte 3 # Advance line 1
313 ; CHECK-NEXT: .byte 1
314 ; CHECK-NEXT: .byte 1
315 ; CHECK-NEXT: .byte 5
316 ; CHECK-NEXT: .byte 3
317 ; CHECK-NEXT: .byte 6
318 ; CHECK-NEXT: .byte 0 # Set address to L..tmp5
319 ; CHECK-NEXT: .byte 5
320 ; CHECK-NEXT: .byte 2
321 ; CHECK-NEXT: .vbyte 4, L..tmp5
322 ; CHECK-NEXT: .byte 3 # Advance line 0
323 ; CHECK-NEXT: .byte 0
324 ; CHECK-NEXT: .byte 1
325 ; CHECK-NEXT: .byte 0 # Set address to L..func_end1
326 ; CHECK-NEXT: .byte 5
327 ; CHECK-NEXT: .byte 2
328 ; CHECK-NEXT: .vbyte 4, L..func_end1
329 ; CHECK-NEXT: .byte 0 # End sequence
330 ; CHECK-NEXT: .byte 1
331 ; CHECK-NEXT: .byte 1
332 ; CHECK-NEXT: L..debug_line_end0: