1 # RUN: yaml2obj %s | llvm-dwarfdump --statistics - | FileCheck %s
3 ## Check that coverage for variable locations which do not cover the parent
4 ## scope is tracked separately in "sum_all_variables(#bytes in any scope
5 ## covered by DW_AT_location)".
7 ## The yaml represents this DWARF:
10 ## DW_AT_low_pc (0x0000000000000000)
11 ## DW_AT_high_pc (0x000000000000000b)
14 ## DW_AT_low_pc (0x0000000000000000)
15 ## DW_AT_high_pc (0x000000000000000b)
17 ## DW_TAG_lexical_block
18 ## DW_AT_ranges (0x00000000
19 ## [0x0000000000000000, 0x0000000000000003)
20 ## [0x0000000000000005, 0x0000000000000008))
22 ## // #bytes in parent scope: 6
23 ## // #bytes in any scope covered by DW_AT_location: 6
24 ## // #bytes in parent scope covered by DW_AT_location: 4
26 ## DW_AT_location (0x00000000:
27 ## [0x0000000000000000, 0x0000000000000006): DW_OP_reg5 RDI)
29 ## // #bytes in parent scope: 6
30 ## // #bytes in any scope covered by DW_AT_location: 2
31 ## // #bytes in parent scope covered by DW_AT_location: 0
33 ## DW_AT_location (0x00000023:
34 ## [0x0000000000000003, 0x0000000000000005): DW_OP_reg2 RCX)
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)": 8
39 # CHECK: "sum_all_variables(#bytes in parent scope covered by DW_AT_location)": 4
51 Content: '00000000000000000600000000000000010055000000000000000000000000000000000300000000000000050000000000000001005200000000000000000000000000000000'
55 Content: '000000000000000003000000000000000500000000000000080000000000000000000000000000000000000000000000'
60 Tag: DW_TAG_compile_unit
61 Children: DW_CHILDREN_yes
63 - Attribute: DW_AT_low_pc
65 - Attribute: DW_AT_high_pc
68 Tag: DW_TAG_subprogram
69 Children: DW_CHILDREN_yes
71 - Attribute: DW_AT_low_pc
73 - Attribute: DW_AT_high_pc
76 Tag: DW_TAG_lexical_block
77 Children: DW_CHILDREN_yes
79 - Attribute: DW_AT_ranges
80 Form: DW_FORM_sec_offset
83 Children: DW_CHILDREN_no
85 - Attribute: DW_AT_location
86 Form: DW_FORM_sec_offset
91 - AbbrCode: 1 ## DW_TAG_compile_unit
93 - Value: 0x00 ## DW_AT_low_pc
94 - Value: 0x0b ## DW_AT_high_pc
95 - AbbrCode: 2 ## DW_TAG_subprogram
97 - Value: 0x00 ## DW_AT_low_pc
98 - Value: 0x0b ## DW_AT_high_pc
99 - AbbrCode: 3 ## DW_TAG_lexical_block
101 - Value: 0x00 ## DW_AT_ranges
102 - AbbrCode: 4 ## DW_TAG_variable
104 - Value: 0x00 ## DW_AT_sec_offset
105 - AbbrCode: 4 ## DW_TAG_variable
107 - Value: 0x23 ## DW_AT_sec_offset
108 - AbbrCode: 0 ## NULL
109 - AbbrCode: 0 ## NULL
110 - AbbrCode: 0 ## NULL