377 lines · plain
1# RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o %t.o2# RUN: not llvm-dwarfdump -verify %t.o 2>&1 | FileCheck %s3 4# CHECK: error: Subprogram with call site entry has no DW_AT_call attribute:5# CHECK: DW_TAG_subprogram6# CHECK: DW_AT_name ("main")7# CHECK: DW_TAG_call_site8# CHECK: DW_AT_call_origin9# CHECK: Errors detected.10 11# Source:12## define void @foo() !dbg !25 {13## ret void, !dbg !2814## }15##16## define i32 @main() !dbg !29 {17## call void @foo(), !dbg !3218## ret i32 0, !dbg !3319## }20##21## !llvm.dbg.cu = !{!2}22## !llvm.module.flags = !{!8, !9, !10, !11}23## !llvm.ident = !{!12}24##25## !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())26## !1 = distinct !DIGlobalVariable(name: "sink", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)27## !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)28## !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")29## !4 = !{}30## !5 = !{!0}31## !6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)32## !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)33## !8 = !{i32 2, !"Dwarf Version", i32 5}34## !9 = !{i32 2, !"Debug Info Version", i32 3}35## !10 = !{i32 1, !"wchar_size", i32 4}36## !11 = !{i32 7, !"PIC Level", i32 2}37## !12 = !{!"clang version 7.0.0 "}38## !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)39## !14 = !DISubroutineType(types: !15)40## !15 = !{null}41## !16 = !DILocation(line: 2, column: 44, scope: !13)42## !17 = !{!18, !18, i64 0}43## !18 = !{!"int", !19, i64 0}44## !19 = !{!"omnipotent char", !20, i64 0}45## !20 = !{!"Simple C++ TBAA"}46## !21 = !DILocation(line: 2, column: 48, scope: !13)47## !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)48## !23 = !DILocation(line: 3, column: 44, scope: !22)49## !24 = !DILocation(line: 3, column: 48, scope: !22)50## !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)51## !26 = !DILocation(line: 5, column: 3, scope: !25)52## !27 = !DILocation(line: 6, column: 3, scope: !25)53## !28 = !DILocation(line: 7, column: 1, scope: !25)54## !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)55## !30 = !DISubroutineType(types: !31)56## !31 = !{!7}57## !32 = !DILocation(line: 8, column: 50, scope: !29)58## !33 = !DILocation(line: 8, column: 57, scope: !29)59 60 .section __TEXT,__text,regular,pure_instructions61 .globl _foo ## -- Begin function foo62_foo: ## @foo63Lfunc_begin0:64 .cfi_startproc65## %bb.0:66 retq67Ltmp0:68Lfunc_end0:69 .cfi_endproc70 ## -- End function71 .globl _main ## -- Begin function main72_main: ## @main73Lfunc_begin1:74 .cfi_startproc75## %bb.0:76 pushq %rax77 .cfi_def_cfa_offset 1678Ltmp1:79 callq _foo80 xorl %eax, %eax81 popq %rcx82 retq83Ltmp2:84Lfunc_end1:85 .cfi_endproc86 ## -- End function87 .section __DWARF,__debug_str_offs,regular,debug88Lsection_str_off:89 .long 3690 .short 591 .short 092Lstr_offsets_base0:93 .section __DWARF,__debug_str,regular,debug94Linfo_string:95 .asciz "clang version 7.0.0 " ## string offset=096 .asciz "/Users/vsk/src/llvm.org-tailcall/tail2.cc" ## string offset=2197 .asciz "/Users/vsk/src/builds/llvm-project-tailcall-RA" ## string offset=6398 .asciz "sink" ## string offset=11099 .asciz "int" ## string offset=115100 .asciz "foo" ## string offset=119101 .asciz "_Z3foov" ## string offset=123102 .asciz "main" ## string offset=131103 .section __DWARF,__debug_str_offs,regular,debug104 .long 0105 .long 21106 .long 63107 .long 110108 .long 115109 .long 119110 .long 123111 .long 131112 .section __DWARF,__debug_abbrev,regular,debug113Lsection_abbrev:114 .byte 1 ## Abbreviation Code115 .byte 17 ## DW_TAG_compile_unit116 .byte 1 ## DW_CHILDREN_yes117 .byte 37 ## DW_AT_producer118 .byte 37 ## DW_FORM_strx1119 .byte 19 ## DW_AT_language120 .byte 5 ## DW_FORM_data2121 .byte 3 ## DW_AT_name122 .byte 37 ## DW_FORM_strx1123 .byte 114 ## DW_AT_str_offsets_base124 .byte 23 ## DW_FORM_sec_offset125 .byte 16 ## DW_AT_stmt_list126 .byte 23 ## DW_FORM_sec_offset127 .byte 27 ## DW_AT_comp_dir128 .byte 37 ## DW_FORM_strx1129 .ascii "\341\177" ## DW_AT_APPLE_optimized130 .byte 25 ## DW_FORM_flag_present131 .byte 17 ## DW_AT_low_pc132 .byte 1 ## DW_FORM_addr133 .byte 18 ## DW_AT_high_pc134 .byte 6 ## DW_FORM_data4135 .byte 0 ## EOM(1)136 .byte 0 ## EOM(2)137 .byte 2 ## Abbreviation Code138 .byte 52 ## DW_TAG_variable139 .byte 0 ## DW_CHILDREN_no140 .byte 3 ## DW_AT_name141 .byte 37 ## DW_FORM_strx1142 .byte 73 ## DW_AT_type143 .byte 19 ## DW_FORM_ref4144 .byte 63 ## DW_AT_external145 .byte 25 ## DW_FORM_flag_present146 .byte 58 ## DW_AT_decl_file147 .byte 11 ## DW_FORM_data1148 .byte 59 ## DW_AT_decl_line149 .byte 11 ## DW_FORM_data1150 .byte 0 ## EOM(1)151 .byte 0 ## EOM(2)152 .byte 3 ## Abbreviation Code153 .byte 53 ## DW_TAG_volatile_type154 .byte 0 ## DW_CHILDREN_no155 .byte 73 ## DW_AT_type156 .byte 19 ## DW_FORM_ref4157 .byte 0 ## EOM(1)158 .byte 0 ## EOM(2)159 .byte 4 ## Abbreviation Code160 .byte 36 ## DW_TAG_base_type161 .byte 0 ## DW_CHILDREN_no162 .byte 3 ## DW_AT_name163 .byte 37 ## DW_FORM_strx1164 .byte 62 ## DW_AT_encoding165 .byte 11 ## DW_FORM_data1166 .byte 11 ## DW_AT_byte_size167 .byte 11 ## DW_FORM_data1168 .byte 0 ## EOM(1)169 .byte 0 ## EOM(2)170 .byte 5 ## Abbreviation Code171 .byte 46 ## DW_TAG_subprogram172 .byte 0 ## DW_CHILDREN_no173 .byte 17 ## DW_AT_low_pc174 .byte 1 ## DW_FORM_addr175 .byte 18 ## DW_AT_high_pc176 .byte 6 ## DW_FORM_data4177 .ascii "\347\177" ## DW_AT_APPLE_omit_frame_ptr178 .byte 25 ## DW_FORM_flag_present179 .byte 64 ## DW_AT_frame_base180 .byte 24 ## DW_FORM_exprloc181## .byte 122 ## DW_AT_call_all_calls182## .byte 25 ## DW_FORM_flag_present183 .byte 110 ## DW_AT_linkage_name184 .byte 37 ## DW_FORM_strx1185 .byte 3 ## DW_AT_name186 .byte 37 ## DW_FORM_strx1187 .byte 58 ## DW_AT_decl_file188 .byte 11 ## DW_FORM_data1189 .byte 59 ## DW_AT_decl_line190 .byte 11 ## DW_FORM_data1191 .byte 63 ## DW_AT_external192 .byte 25 ## DW_FORM_flag_present193 .ascii "\341\177" ## DW_AT_APPLE_optimized194 .byte 25 ## DW_FORM_flag_present195 .byte 0 ## EOM(1)196 .byte 0 ## EOM(2)197 .byte 6 ## Abbreviation Code198 .byte 46 ## DW_TAG_subprogram199 .byte 1 ## DW_CHILDREN_yes200 .byte 17 ## DW_AT_low_pc201 .byte 1 ## DW_FORM_addr202 .byte 18 ## DW_AT_high_pc203 .byte 6 ## DW_FORM_data4204 .ascii "\347\177" ## DW_AT_APPLE_omit_frame_ptr205 .byte 25 ## DW_FORM_flag_present206 .byte 64 ## DW_AT_frame_base207 .byte 24 ## DW_FORM_exprloc208## .byte 122 ## DW_AT_call_all_calls209## .byte 25 ## DW_FORM_flag_present210 .byte 3 ## DW_AT_name211 .byte 37 ## DW_FORM_strx1212 .byte 58 ## DW_AT_decl_file213 .byte 11 ## DW_FORM_data1214 .byte 59 ## DW_AT_decl_line215 .byte 11 ## DW_FORM_data1216 .byte 73 ## DW_AT_type217 .byte 19 ## DW_FORM_ref4218 .byte 63 ## DW_AT_external219 .byte 25 ## DW_FORM_flag_present220 .ascii "\341\177" ## DW_AT_APPLE_optimized221 .byte 25 ## DW_FORM_flag_present222 .byte 0 ## EOM(1)223 .byte 0 ## EOM(2)224 .byte 7 ## Abbreviation Code225 .byte 72 ## DW_TAG_call_site226 .byte 0 ## DW_CHILDREN_no227 .byte 127 ## DW_AT_call_origin228 .byte 19 ## DW_FORM_ref4229 .byte 0 ## EOM(1)230 .byte 0 ## EOM(2)231 .byte 0 ## EOM(3)232 .section __DWARF,__debug_info,regular,debug233Lsection_info:234Lcu_begin0:235 .long 99 ## Length of Unit236 .short 5 ## DWARF version number237 .byte 1 ## DWARF Unit Type238 .byte 8 ## Address Size (in bytes)239.set Lset0, Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section240 .long Lset0241 .byte 1 ## Abbrev [1] 0xc:0x5b DW_TAG_compile_unit242 .byte 0 ## DW_AT_producer243 .short 4 ## DW_AT_language244 .byte 1 ## DW_AT_name245.set Lset1, Lstr_offsets_base0-Lsection_str_off ## DW_AT_str_offsets_base246 .long Lset1247.set Lset2, Lline_table_start0-Lsection_line ## DW_AT_stmt_list248 .long Lset2249 .byte 2 ## DW_AT_comp_dir250 ## DW_AT_APPLE_optimized251 .quad Lfunc_begin0 ## DW_AT_low_pc252.set Lset3, Lfunc_end1-Lfunc_begin0 ## DW_AT_high_pc253 .long Lset3254 .byte 2 ## Abbrev [2] 0x26:0x8 DW_TAG_variable255 .byte 3 ## DW_AT_name256 .long 46 ## DW_AT_type257 ## DW_AT_external258 .byte 1 ## DW_AT_decl_file259 .byte 1 ## DW_AT_decl_line260 .byte 3 ## Abbrev [3] 0x2e:0x5 DW_TAG_volatile_type261 .long 51 ## DW_AT_type262 .byte 4 ## Abbrev [4] 0x33:0x4 DW_TAG_base_type263 .byte 4 ## DW_AT_name264 .byte 5 ## DW_AT_encoding265 .byte 4 ## DW_AT_byte_size266 .byte 5 ## Abbrev [5] 0x37:0x13 DW_TAG_subprogram267 .quad Lfunc_begin0 ## DW_AT_low_pc268.set Lset4, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc269 .long Lset4270 ## DW_AT_APPLE_omit_frame_ptr271 .byte 1 ## DW_AT_frame_base272 .byte 87273 ## DW_AT_call_all_calls274 .byte 6 ## DW_AT_linkage_name275 .byte 5 ## DW_AT_name276 .byte 1 ## DW_AT_decl_file277 .byte 4 ## DW_AT_decl_line278 ## DW_AT_external279 ## DW_AT_APPLE_optimized280 .byte 6 ## Abbrev [6] 0x4a:0x1c DW_TAG_subprogram281 .quad Lfunc_begin1 ## DW_AT_low_pc282.set Lset5, Lfunc_end1-Lfunc_begin1 ## DW_AT_high_pc283 .long Lset5284 ## DW_AT_APPLE_omit_frame_ptr285 .byte 1 ## DW_AT_frame_base286 .byte 87287 ## DW_AT_call_all_calls288 .byte 7 ## DW_AT_name289 .byte 1 ## DW_AT_decl_file290 .byte 8 ## DW_AT_decl_line291 .long 51 ## DW_AT_type292 ## DW_AT_external293 ## DW_AT_APPLE_optimized294 .byte 7 ## Abbrev [7] 0x60:0x5 DW_TAG_call_site295 .long 55 ## DW_AT_call_origin296 .byte 0 ## End Of Children Mark297 .byte 0 ## End Of Children Mark298 .section __DWARF,__debug_macinfo,regular,debug299Ldebug_macinfo:300 .byte 0 ## End Of Macro List Mark301 .section __DWARF,__debug_names,regular,debug302Ldebug_names_begin:303.set Lset6, Lnames_end0-Lnames_start0 ## Header: unit length304 .long Lset6305Lnames_start0:306 .short 5 ## Header: version307 .short 0 ## Header: padding308 .long 1 ## Header: compilation unit count309 .long 0 ## Header: local type unit count310 .long 0 ## Header: foreign type unit count311 .long 4 ## Header: bucket count312 .long 4 ## Header: name count313.set Lset7, Lnames_abbrev_end0-Lnames_abbrev_start0 ## Header: abbreviation table size314 .long Lset7315 .long 8 ## Header: augmentation string size316 .ascii "LLVM0700" ## Header: augmentation string317.set Lset8, Lcu_begin0-Lsection_info ## Compilation unit 0318 .long Lset8319 .long 1 ## Bucket 0320 .long 2 ## Bucket 1321 .long 3 ## Bucket 2322 .long 4 ## Bucket 3323 .long 193495088 ## Hash in Bucket 0324 .long 193491849 ## Hash in Bucket 1325 .long 2090499946 ## Hash in Bucket 2326 .long -1257882357 ## Hash in Bucket 3327 .long 115 ## String in Bucket 0: int328 .long 119 ## String in Bucket 1: foo329 .long 131 ## String in Bucket 2: main330 .long 123 ## String in Bucket 3: _Z3foov331.set Lset9, Lnames3-Lnames_entries0 ## Offset in Bucket 0332 .long Lset9333.set Lset10, Lnames0-Lnames_entries0 ## Offset in Bucket 1334 .long Lset10335.set Lset11, Lnames1-Lnames_entries0 ## Offset in Bucket 2336 .long Lset11337.set Lset12, Lnames2-Lnames_entries0 ## Offset in Bucket 3338 .long Lset12339Lnames_abbrev_start0:340 .byte 46 ## Abbrev code341 .byte 46 ## DW_TAG_subprogram342 .byte 3 ## DW_IDX_die_offset343 .byte 19 ## DW_FORM_ref4344 .byte 0 ## End of abbrev345 .byte 0 ## End of abbrev346 .byte 36 ## Abbrev code347 .byte 36 ## DW_TAG_base_type348 .byte 3 ## DW_IDX_die_offset349 .byte 19 ## DW_FORM_ref4350 .byte 0 ## End of abbrev351 .byte 0 ## End of abbrev352 .byte 0 ## End of abbrev list353Lnames_abbrev_end0:354Lnames_entries0:355Lnames3:356 .byte 36 ## Abbreviation code357 .long 51 ## DW_IDX_die_offset358 .long 0 ## End of list: int359Lnames0:360 .byte 46 ## Abbreviation code361 .long 55 ## DW_IDX_die_offset362 .long 0 ## End of list: foo363Lnames1:364 .byte 46 ## Abbreviation code365 .long 74 ## DW_IDX_die_offset366 .long 0 ## End of list: main367Lnames2:368 .byte 46 ## Abbreviation code369 .long 55 ## DW_IDX_die_offset370 .long 0 ## End of list: _Z3foov371Lnames_end0:372 373.subsections_via_symbols374 .section __DWARF,__debug_line,regular,debug375Lsection_line:376Lline_table_start0:377