111 lines · yaml
1# RUN: yaml2obj %s | llvm-dwarfdump --statistics - | FileCheck %s2 3## Check that coverage for variable locations which do not cover the parent4## scope is tracked separately in "sum_all_variables(#bytes in any scope5## covered by DW_AT_location)".6##7## The yaml represents this DWARF:8##9## DW_TAG_compile_unit10## DW_AT_low_pc (0x0000000000000000)11## DW_AT_high_pc (0x000000000000000b)12##13## DW_TAG_subprogram14## DW_AT_low_pc (0x0000000000000000)15## DW_AT_high_pc (0x000000000000000b)16##17## DW_TAG_lexical_block18## DW_AT_ranges (0x0000000019## [0x0000000000000000, 0x0000000000000003)20## [0x0000000000000005, 0x0000000000000008))21##22## // #bytes in parent scope: 623## // #bytes in any scope covered by DW_AT_location: 624## // #bytes in parent scope covered by DW_AT_location: 425## DW_TAG_variable26## DW_AT_location (0x00000000:27## [0x0000000000000000, 0x0000000000000006): DW_OP_reg5 RDI)28##29## // #bytes in parent scope: 630## // #bytes in any scope covered by DW_AT_location: 231## // #bytes in parent scope covered by DW_AT_location: 032## DW_TAG_variable33## DW_AT_location (0x00000023:34## [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX)35 36# CHECK: "version": 9,37# CHECK: "sum_all_variables(#bytes in parent scope)": 12,38# CHECK: "sum_all_variables(#bytes in any scope covered by DW_AT_location)": 839# CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)": 440 41--- !ELF42FileHeader:43 Class: ELFCLASS6444 Data: ELFDATA2LSB45 Type: ET_EXEC46 Machine: EM_X86_6447Sections:48 - Name: .debug_loc49 Type: SHT_PROGBITS50 AddressAlign: 0x0151 Content: '00000000000000000600000000000000010055000000000000000000000000000000000300000000000000050000000000000001005200000000000000000000000000000000'52 - Name: .debug_ranges53 Type: SHT_PROGBITS54 AddressAlign: 0x0155 Content: '000000000000000003000000000000000500000000000000080000000000000000000000000000000000000000000000'56DWARF:57 debug_abbrev:58 - Table:59 - Code: 160 Tag: DW_TAG_compile_unit61 Children: DW_CHILDREN_yes62 Attributes:63 - Attribute: DW_AT_low_pc64 Form: DW_FORM_addr65 - Attribute: DW_AT_high_pc66 Form: DW_FORM_data467 - Code: 268 Tag: DW_TAG_subprogram69 Children: DW_CHILDREN_yes70 Attributes:71 - Attribute: DW_AT_low_pc72 Form: DW_FORM_addr73 - Attribute: DW_AT_high_pc74 Form: DW_FORM_data475 - Code: 376 Tag: DW_TAG_lexical_block77 Children: DW_CHILDREN_yes78 Attributes:79 - Attribute: DW_AT_ranges80 Form: DW_FORM_sec_offset81 - Code: 482 Tag: DW_TAG_variable83 Children: DW_CHILDREN_no84 Attributes:85 - Attribute: DW_AT_location86 Form: DW_FORM_sec_offset87 debug_info:88 - Version: 489 AbbrOffset: 0x0090 Entries:91 - AbbrCode: 1 ## DW_TAG_compile_unit92 Values:93 - Value: 0x00 ## DW_AT_low_pc94 - Value: 0x0b ## DW_AT_high_pc95 - AbbrCode: 2 ## DW_TAG_subprogram96 Values:97 - Value: 0x00 ## DW_AT_low_pc98 - Value: 0x0b ## DW_AT_high_pc99 - AbbrCode: 3 ## DW_TAG_lexical_block100 Values:101 - Value: 0x00 ## DW_AT_ranges102 - AbbrCode: 4 ## DW_TAG_variable103 Values:104 - Value: 0x00 ## DW_AT_sec_offset105 - AbbrCode: 4 ## DW_TAG_variable106 Values:107 - Value: 0x23 ## DW_AT_sec_offset108 - AbbrCode: 0 ## NULL109 - AbbrCode: 0 ## NULL110 - AbbrCode: 0 ## NULL111