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