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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376
|
# RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o %t.o
# RUN: not llvm-dwarfdump -verify %t.o 2>&1 | FileCheck %s
# CHECK: error: Subprogram with call site entry has no DW_AT_call attribute:
# CHECK: DW_TAG_subprogram
# CHECK: DW_AT_name ("main")
# CHECK: DW_TAG_call_site
# CHECK: DW_AT_call_origin
# CHECK: Errors detected.
# Source:
## define void @foo() !dbg !25 {
## ret void, !dbg !28
## }
##
## define i32 @main() !dbg !29 {
## call void @foo(), !dbg !32
## ret i32 0, !dbg !33
## }
##
## !llvm.dbg.cu = !{!2}
## !llvm.module.flags = !{!8, !9, !10, !11}
## !llvm.ident = !{!12}
##
## !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
## !1 = distinct !DIGlobalVariable(name: "sink", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
## !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
## !3 = !DIFile(filename: "/Users/vsk/src/llvm.org-tailcall/tail2.cc", directory: "/Users/vsk/src/builds/llvm-project-tailcall-RA", checksumkind: CSK_MD5, checksum: "3b61952c21b7f657ddb7c0ad44cf5529")
## !4 = !{}
## !5 = !{!0}
## !6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
## !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
## !8 = !{i32 2, !"Dwarf Version", i32 5}
## !9 = !{i32 2, !"Debug Info Version", i32 3}
## !10 = !{i32 1, !"wchar_size", i32 4}
## !11 = !{i32 7, !"PIC Level", i32 2}
## !12 = !{!"clang version 7.0.0 "}
## !13 = distinct !DISubprogram(name: "bat", linkageName: "_Z3batv", scope: !3, file: !3, line: 2, type: !14, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, isOptimized: true, unit: !2, retainedNodes: !4)
## !14 = !DISubroutineType(types: !15)
## !15 = !{null}
## !16 = !DILocation(line: 2, column: 44, scope: !13)
## !17 = !{!18, !18, i64 0}
## !18 = !{!"int", !19, i64 0}
## !19 = !{!"omnipotent char", !20, i64 0}
## !20 = !{!"Simple C++ TBAA"}
## !21 = !DILocation(line: 2, column: 48, scope: !13)
## !22 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !3, file: !3, line: 3, type: !14, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, isOptimized: true, unit: !2, retainedNodes: !4)
## !23 = !DILocation(line: 3, column: 44, scope: !22)
## !24 = !DILocation(line: 3, column: 48, scope: !22)
## !25 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !3, file: !3, line: 4, type: !14, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, isOptimized: true, unit: !2, retainedNodes: !4)
## !26 = !DILocation(line: 5, column: 3, scope: !25)
## !27 = !DILocation(line: 6, column: 3, scope: !25)
## !28 = !DILocation(line: 7, column: 1, scope: !25)
## !29 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 8, type: !30, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, isOptimized: true, unit: !2, retainedNodes: !4)
## !30 = !DISubroutineType(types: !31)
## !31 = !{!7}
## !32 = !DILocation(line: 8, column: 50, scope: !29)
## !33 = !DILocation(line: 8, column: 57, scope: !29)
.section __TEXT,__text,regular,pure_instructions
.globl _foo ## -- Begin function foo
_foo: ## @foo
Lfunc_begin0:
.cfi_startproc
## %bb.0:
retq
Ltmp0:
Lfunc_end0:
.cfi_endproc
## -- End function
.globl _main ## -- Begin function main
_main: ## @main
Lfunc_begin1:
.cfi_startproc
## %bb.0:
pushq %rax
.cfi_def_cfa_offset 16
Ltmp1:
callq _foo
xorl %eax, %eax
popq %rcx
retq
Ltmp2:
Lfunc_end1:
.cfi_endproc
## -- End function
.section __DWARF,__debug_str_offs,regular,debug
Lsection_str_off:
.long 36
.short 5
.short 0
Lstr_offsets_base0:
.section __DWARF,__debug_str,regular,debug
Linfo_string:
.asciz "clang version 7.0.0 " ## string offset=0
.asciz "/Users/vsk/src/llvm.org-tailcall/tail2.cc" ## string offset=21
.asciz "/Users/vsk/src/builds/llvm-project-tailcall-RA" ## string offset=63
.asciz "sink" ## string offset=110
.asciz "int" ## string offset=115
.asciz "foo" ## string offset=119
.asciz "_Z3foov" ## string offset=123
.asciz "main" ## string offset=131
.section __DWARF,__debug_str_offs,regular,debug
.long 0
.long 21
.long 63
.long 110
.long 115
.long 119
.long 123
.long 131
.section __DWARF,__debug_abbrev,regular,debug
Lsection_abbrev:
.byte 1 ## Abbreviation Code
.byte 17 ## DW_TAG_compile_unit
.byte 1 ## DW_CHILDREN_yes
.byte 37 ## DW_AT_producer
.byte 37 ## DW_FORM_strx1
.byte 19 ## DW_AT_language
.byte 5 ## DW_FORM_data2
.byte 3 ## DW_AT_name
.byte 37 ## DW_FORM_strx1
.byte 114 ## DW_AT_str_offsets_base
.byte 23 ## DW_FORM_sec_offset
.byte 16 ## DW_AT_stmt_list
.byte 23 ## DW_FORM_sec_offset
.byte 27 ## DW_AT_comp_dir
.byte 37 ## DW_FORM_strx1
.ascii "\341\177" ## DW_AT_APPLE_optimized
.byte 25 ## DW_FORM_flag_present
.byte 17 ## DW_AT_low_pc
.byte 1 ## DW_FORM_addr
.byte 18 ## DW_AT_high_pc
.byte 6 ## DW_FORM_data4
.byte 0 ## EOM(1)
.byte 0 ## EOM(2)
.byte 2 ## Abbreviation Code
.byte 52 ## DW_TAG_variable
.byte 0 ## DW_CHILDREN_no
.byte 3 ## DW_AT_name
.byte 37 ## DW_FORM_strx1
.byte 73 ## DW_AT_type
.byte 19 ## DW_FORM_ref4
.byte 63 ## DW_AT_external
.byte 25 ## DW_FORM_flag_present
.byte 58 ## DW_AT_decl_file
.byte 11 ## DW_FORM_data1
.byte 59 ## DW_AT_decl_line
.byte 11 ## DW_FORM_data1
.byte 0 ## EOM(1)
.byte 0 ## EOM(2)
.byte 3 ## Abbreviation Code
.byte 53 ## DW_TAG_volatile_type
.byte 0 ## DW_CHILDREN_no
.byte 73 ## DW_AT_type
.byte 19 ## DW_FORM_ref4
.byte 0 ## EOM(1)
.byte 0 ## EOM(2)
.byte 4 ## Abbreviation Code
.byte 36 ## DW_TAG_base_type
.byte 0 ## DW_CHILDREN_no
.byte 3 ## DW_AT_name
.byte 37 ## DW_FORM_strx1
.byte 62 ## DW_AT_encoding
.byte 11 ## DW_FORM_data1
.byte 11 ## DW_AT_byte_size
.byte 11 ## DW_FORM_data1
.byte 0 ## EOM(1)
.byte 0 ## EOM(2)
.byte 5 ## Abbreviation Code
.byte 46 ## DW_TAG_subprogram
.byte 0 ## DW_CHILDREN_no
.byte 17 ## DW_AT_low_pc
.byte 1 ## DW_FORM_addr
.byte 18 ## DW_AT_high_pc
.byte 6 ## DW_FORM_data4
.ascii "\347\177" ## DW_AT_APPLE_omit_frame_ptr
.byte 25 ## DW_FORM_flag_present
.byte 64 ## DW_AT_frame_base
.byte 24 ## DW_FORM_exprloc
## .byte 122 ## DW_AT_call_all_calls
## .byte 25 ## DW_FORM_flag_present
.byte 110 ## DW_AT_linkage_name
.byte 37 ## DW_FORM_strx1
.byte 3 ## DW_AT_name
.byte 37 ## DW_FORM_strx1
.byte 58 ## DW_AT_decl_file
.byte 11 ## DW_FORM_data1
.byte 59 ## DW_AT_decl_line
.byte 11 ## DW_FORM_data1
.byte 63 ## DW_AT_external
.byte 25 ## DW_FORM_flag_present
.ascii "\341\177" ## DW_AT_APPLE_optimized
.byte 25 ## DW_FORM_flag_present
.byte 0 ## EOM(1)
.byte 0 ## EOM(2)
.byte 6 ## Abbreviation Code
.byte 46 ## DW_TAG_subprogram
.byte 1 ## DW_CHILDREN_yes
.byte 17 ## DW_AT_low_pc
.byte 1 ## DW_FORM_addr
.byte 18 ## DW_AT_high_pc
.byte 6 ## DW_FORM_data4
.ascii "\347\177" ## DW_AT_APPLE_omit_frame_ptr
.byte 25 ## DW_FORM_flag_present
.byte 64 ## DW_AT_frame_base
.byte 24 ## DW_FORM_exprloc
## .byte 122 ## DW_AT_call_all_calls
## .byte 25 ## DW_FORM_flag_present
.byte 3 ## DW_AT_name
.byte 37 ## DW_FORM_strx1
.byte 58 ## DW_AT_decl_file
.byte 11 ## DW_FORM_data1
.byte 59 ## DW_AT_decl_line
.byte 11 ## DW_FORM_data1
.byte 73 ## DW_AT_type
.byte 19 ## DW_FORM_ref4
.byte 63 ## DW_AT_external
.byte 25 ## DW_FORM_flag_present
.ascii "\341\177" ## DW_AT_APPLE_optimized
.byte 25 ## DW_FORM_flag_present
.byte 0 ## EOM(1)
.byte 0 ## EOM(2)
.byte 7 ## Abbreviation Code
.byte 72 ## DW_TAG_call_site
.byte 0 ## DW_CHILDREN_no
.byte 127 ## DW_AT_call_origin
.byte 19 ## DW_FORM_ref4
.byte 0 ## EOM(1)
.byte 0 ## EOM(2)
.byte 0 ## EOM(3)
.section __DWARF,__debug_info,regular,debug
Lsection_info:
Lcu_begin0:
.long 99 ## Length of Unit
.short 5 ## DWARF version number
.byte 1 ## DWARF Unit Type
.byte 8 ## Address Size (in bytes)
.set Lset0, Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section
.long Lset0
.byte 1 ## Abbrev [1] 0xc:0x5b DW_TAG_compile_unit
.byte 0 ## DW_AT_producer
.short 4 ## DW_AT_language
.byte 1 ## DW_AT_name
.set Lset1, Lstr_offsets_base0-Lsection_str_off ## DW_AT_str_offsets_base
.long Lset1
.set Lset2, Lline_table_start0-Lsection_line ## DW_AT_stmt_list
.long Lset2
.byte 2 ## DW_AT_comp_dir
## DW_AT_APPLE_optimized
.quad Lfunc_begin0 ## DW_AT_low_pc
.set Lset3, Lfunc_end1-Lfunc_begin0 ## DW_AT_high_pc
.long Lset3
.byte 2 ## Abbrev [2] 0x26:0x8 DW_TAG_variable
.byte 3 ## DW_AT_name
.long 46 ## DW_AT_type
## DW_AT_external
.byte 1 ## DW_AT_decl_file
.byte 1 ## DW_AT_decl_line
.byte 3 ## Abbrev [3] 0x2e:0x5 DW_TAG_volatile_type
.long 51 ## DW_AT_type
.byte 4 ## Abbrev [4] 0x33:0x4 DW_TAG_base_type
.byte 4 ## DW_AT_name
.byte 5 ## DW_AT_encoding
.byte 4 ## DW_AT_byte_size
.byte 5 ## Abbrev [5] 0x37:0x13 DW_TAG_subprogram
.quad Lfunc_begin0 ## DW_AT_low_pc
.set Lset4, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc
.long Lset4
## DW_AT_APPLE_omit_frame_ptr
.byte 1 ## DW_AT_frame_base
.byte 87
## DW_AT_call_all_calls
.byte 6 ## DW_AT_linkage_name
.byte 5 ## DW_AT_name
.byte 1 ## DW_AT_decl_file
.byte 4 ## DW_AT_decl_line
## DW_AT_external
## DW_AT_APPLE_optimized
.byte 6 ## Abbrev [6] 0x4a:0x1c DW_TAG_subprogram
.quad Lfunc_begin1 ## DW_AT_low_pc
.set Lset5, Lfunc_end1-Lfunc_begin1 ## DW_AT_high_pc
.long Lset5
## DW_AT_APPLE_omit_frame_ptr
.byte 1 ## DW_AT_frame_base
.byte 87
## DW_AT_call_all_calls
.byte 7 ## DW_AT_name
.byte 1 ## DW_AT_decl_file
.byte 8 ## DW_AT_decl_line
.long 51 ## DW_AT_type
## DW_AT_external
## DW_AT_APPLE_optimized
.byte 7 ## Abbrev [7] 0x60:0x5 DW_TAG_call_site
.long 55 ## DW_AT_call_origin
.byte 0 ## End Of Children Mark
.byte 0 ## End Of Children Mark
.section __DWARF,__debug_macinfo,regular,debug
Ldebug_macinfo:
.byte 0 ## End Of Macro List Mark
.section __DWARF,__debug_names,regular,debug
Ldebug_names_begin:
.set Lset6, Lnames_end0-Lnames_start0 ## Header: unit length
.long Lset6
Lnames_start0:
.short 5 ## Header: version
.short 0 ## Header: padding
.long 1 ## Header: compilation unit count
.long 0 ## Header: local type unit count
.long 0 ## Header: foreign type unit count
.long 4 ## Header: bucket count
.long 4 ## Header: name count
.set Lset7, Lnames_abbrev_end0-Lnames_abbrev_start0 ## Header: abbreviation table size
.long Lset7
.long 8 ## Header: augmentation string size
.ascii "LLVM0700" ## Header: augmentation string
.set Lset8, Lcu_begin0-Lsection_info ## Compilation unit 0
.long Lset8
.long 1 ## Bucket 0
.long 2 ## Bucket 1
.long 3 ## Bucket 2
.long 4 ## Bucket 3
.long 193495088 ## Hash in Bucket 0
.long 193491849 ## Hash in Bucket 1
.long 2090499946 ## Hash in Bucket 2
.long -1257882357 ## Hash in Bucket 3
.long 115 ## String in Bucket 0: int
.long 119 ## String in Bucket 1: foo
.long 131 ## String in Bucket 2: main
.long 123 ## String in Bucket 3: _Z3foov
.set Lset9, Lnames3-Lnames_entries0 ## Offset in Bucket 0
.long Lset9
.set Lset10, Lnames0-Lnames_entries0 ## Offset in Bucket 1
.long Lset10
.set Lset11, Lnames1-Lnames_entries0 ## Offset in Bucket 2
.long Lset11
.set Lset12, Lnames2-Lnames_entries0 ## Offset in Bucket 3
.long Lset12
Lnames_abbrev_start0:
.byte 46 ## Abbrev code
.byte 46 ## DW_TAG_subprogram
.byte 3 ## DW_IDX_die_offset
.byte 19 ## DW_FORM_ref4
.byte 0 ## End of abbrev
.byte 0 ## End of abbrev
.byte 36 ## Abbrev code
.byte 36 ## DW_TAG_base_type
.byte 3 ## DW_IDX_die_offset
.byte 19 ## DW_FORM_ref4
.byte 0 ## End of abbrev
.byte 0 ## End of abbrev
.byte 0 ## End of abbrev list
Lnames_abbrev_end0:
Lnames_entries0:
Lnames3:
.byte 36 ## Abbreviation code
.long 51 ## DW_IDX_die_offset
.long 0 ## End of list: int
Lnames0:
.byte 46 ## Abbreviation code
.long 55 ## DW_IDX_die_offset
.long 0 ## End of list: foo
Lnames1:
.byte 46 ## Abbreviation code
.long 74 ## DW_IDX_die_offset
.long 0 ## End of list: main
Lnames2:
.byte 46 ## Abbreviation code
.long 55 ## DW_IDX_die_offset
.long 0 ## End of list: _Z3foov
Lnames_end0:
.subsections_via_symbols
.section __DWARF,__debug_line,regular,debug
Lsection_line:
Lline_table_start0:
|