xref: /llvm-project/llvm/test/tools/llvm-dwarfutil/ELF/X86/gc-unit-overlapping-address-ranges.test (revision f1fdfe6888f93b9f6dfb4689e1f3206de584ff5b)
18bb4451aSAlexey Lapshin## This test checks that overlapping compile unit address ranges
28bb4451aSAlexey Lapshin## are ignored (i.e. left unchanged) by --garbage-collection
38bb4451aSAlexey Lapshin## optimisation.
48bb4451aSAlexey Lapshin
58bb4451aSAlexey Lapshin# RUN: yaml2obj %s -o %t.o
6b61ac4a8Savl-llvm# RUN: llvm-dwarfutil --no-odr --garbage-collection %t.o %t1
78bb4451aSAlexey Lapshin# RUN: llvm-dwarfdump -a %t1 | FileCheck %s
88bb4451aSAlexey Lapshin
9*f1fdfe68SAlexey Lapshin# RUN: llvm-dwarfutil --no-odr --linker parallel --garbage-collection %t.o %t1
105f2a7fa6SAlexey Lapshin# RUN: llvm-dwarfdump -a %t1 | FileCheck %s
115f2a7fa6SAlexey Lapshin
128bb4451aSAlexey Lapshin# CHECK: DW_TAG_compile_unit
138bb4451aSAlexey Lapshin# CHECK: DW_AT_name{{.*}}"CU1"
148bb4451aSAlexey Lapshin# CHECK: DW_TAG_class_type
158bb4451aSAlexey Lapshin# CHECK: DW_AT_name{{.*}}"class1"
168bb4451aSAlexey Lapshin# CHECK: DW_TAG_subprogram
178bb4451aSAlexey Lapshin# CHECK: DW_AT_name{{.*}}"foo1"
188bb4451aSAlexey Lapshin# CHECK: DW_AT_low_pc{{.*}}0x0000000000001000
198bb4451aSAlexey Lapshin# CHECK: DW_AT_high_pc{{.*}}0x0000000000001010
208bb4451aSAlexey Lapshin# CHECK: DW_TAG_subprogram
218bb4451aSAlexey Lapshin# CHECK: DW_AT_name{{.*}}"foo2"
228bb4451aSAlexey Lapshin# CHECK: DW_AT_low_pc{{.*}}0x0000000000001000
238bb4451aSAlexey Lapshin# CHECK: DW_AT_high_pc{{.*}}0x0000000000001010
248bb4451aSAlexey Lapshin# CHECK: DW_AT_type{{.*}}"class2"
258bb4451aSAlexey Lapshin
268bb4451aSAlexey Lapshin--- !ELF
278bb4451aSAlexey LapshinFileHeader:
288bb4451aSAlexey Lapshin  Class:    ELFCLASS64
298bb4451aSAlexey Lapshin  Data:     ELFDATA2LSB
308bb4451aSAlexey Lapshin  Type:     ET_REL
318bb4451aSAlexey Lapshin  Machine:  EM_X86_64
328bb4451aSAlexey LapshinSections:
338bb4451aSAlexey Lapshin  - Name:            .text
348bb4451aSAlexey Lapshin    Type:            SHT_PROGBITS
358bb4451aSAlexey Lapshin    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
368bb4451aSAlexey Lapshin    Address:         0x1000
378bb4451aSAlexey Lapshin    AddressAlign:    0x0000000000000010
388bb4451aSAlexey Lapshin    Content:        "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
398bb4451aSAlexey LapshinDWARF:
408bb4451aSAlexey Lapshin  debug_abbrev:
418bb4451aSAlexey Lapshin    - Table:
428bb4451aSAlexey Lapshin      - Tag:      DW_TAG_compile_unit
438bb4451aSAlexey Lapshin        Children: DW_CHILDREN_yes
448bb4451aSAlexey Lapshin        Attributes:
458bb4451aSAlexey Lapshin          - Attribute: DW_AT_producer
468bb4451aSAlexey Lapshin            Form:      DW_FORM_string
478bb4451aSAlexey Lapshin          - Attribute: DW_AT_language
488bb4451aSAlexey Lapshin            Form:      DW_FORM_data2
498bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
508bb4451aSAlexey Lapshin            Form:      DW_FORM_string
518bb4451aSAlexey Lapshin          - Attribute: DW_AT_low_pc
528bb4451aSAlexey Lapshin            Form:      DW_FORM_addr
538bb4451aSAlexey Lapshin          - Attribute: DW_AT_high_pc
548bb4451aSAlexey Lapshin            Form:      DW_FORM_data8
558bb4451aSAlexey Lapshin      - Tag:      DW_TAG_subprogram
568bb4451aSAlexey Lapshin        Children: DW_CHILDREN_no
578bb4451aSAlexey Lapshin        Attributes:
588bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
598bb4451aSAlexey Lapshin            Form:      DW_FORM_string
608bb4451aSAlexey Lapshin          - Attribute: DW_AT_low_pc
618bb4451aSAlexey Lapshin            Form:      DW_FORM_addr
628bb4451aSAlexey Lapshin          - Attribute: DW_AT_high_pc
638bb4451aSAlexey Lapshin            Form:      DW_FORM_data8
648bb4451aSAlexey Lapshin          - Attribute: DW_AT_type
658bb4451aSAlexey Lapshin            Form:      DW_FORM_ref4
668bb4451aSAlexey Lapshin      - Tag:      DW_TAG_class_type
678bb4451aSAlexey Lapshin        Children: DW_CHILDREN_yes
688bb4451aSAlexey Lapshin        Attributes:
698bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
708bb4451aSAlexey Lapshin            Form:      DW_FORM_string
718bb4451aSAlexey Lapshin      - Tag:      DW_TAG_member
728bb4451aSAlexey Lapshin        Children: DW_CHILDREN_no
738bb4451aSAlexey Lapshin        Attributes:
748bb4451aSAlexey Lapshin          - Attribute: DW_AT_type
758bb4451aSAlexey Lapshin            Form:      DW_FORM_ref4
768bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
778bb4451aSAlexey Lapshin            Form:      DW_FORM_string
788bb4451aSAlexey Lapshin      - Tag:      DW_TAG_class_type
798bb4451aSAlexey Lapshin        Children: DW_CHILDREN_no
808bb4451aSAlexey Lapshin        Attributes:
818bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
828bb4451aSAlexey Lapshin            Form:      DW_FORM_string
838bb4451aSAlexey Lapshin          - Attribute: DW_AT_declaration
848bb4451aSAlexey Lapshin            Form:      DW_FORM_flag_present
858bb4451aSAlexey Lapshin      - Tag:      DW_TAG_class_type
868bb4451aSAlexey Lapshin        Children: DW_CHILDREN_yes
878bb4451aSAlexey Lapshin        Attributes:
888bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
898bb4451aSAlexey Lapshin            Form:      DW_FORM_string
908bb4451aSAlexey Lapshin          - Attribute: DW_AT_declaration
918bb4451aSAlexey Lapshin            Form:      DW_FORM_flag_present
928bb4451aSAlexey Lapshin      - Tag:      DW_TAG_template_type_parameter
938bb4451aSAlexey Lapshin        Children: DW_CHILDREN_no
948bb4451aSAlexey Lapshin        Attributes:
958bb4451aSAlexey Lapshin          - Attribute: DW_AT_type
968bb4451aSAlexey Lapshin            Form:      DW_FORM_ref4
978bb4451aSAlexey Lapshin      - Tag:      DW_TAG_base_type
988bb4451aSAlexey Lapshin        Children: DW_CHILDREN_no
998bb4451aSAlexey Lapshin        Attributes:
1008bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
1018bb4451aSAlexey Lapshin            Form:      DW_FORM_string
1028bb4451aSAlexey Lapshin    - Table:
1038bb4451aSAlexey Lapshin      - Tag:      DW_TAG_compile_unit
1048bb4451aSAlexey Lapshin        Children: DW_CHILDREN_yes
1058bb4451aSAlexey Lapshin        Attributes:
1068bb4451aSAlexey Lapshin          - Attribute: DW_AT_producer
1078bb4451aSAlexey Lapshin            Form:      DW_FORM_string
1088bb4451aSAlexey Lapshin          - Attribute: DW_AT_language
1098bb4451aSAlexey Lapshin            Form:      DW_FORM_data2
1108bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
1118bb4451aSAlexey Lapshin            Form:      DW_FORM_string
1128bb4451aSAlexey Lapshin          - Attribute: DW_AT_low_pc
1138bb4451aSAlexey Lapshin            Form:      DW_FORM_addr
1148bb4451aSAlexey Lapshin          - Attribute: DW_AT_high_pc
1158bb4451aSAlexey Lapshin            Form:      DW_FORM_data8
1168bb4451aSAlexey Lapshin      - Tag:      DW_TAG_subprogram
1178bb4451aSAlexey Lapshin        Children: DW_CHILDREN_no
1188bb4451aSAlexey Lapshin        Attributes:
1198bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
1208bb4451aSAlexey Lapshin            Form:      DW_FORM_string
1218bb4451aSAlexey Lapshin          - Attribute: DW_AT_low_pc
1228bb4451aSAlexey Lapshin            Form:      DW_FORM_addr
1238bb4451aSAlexey Lapshin          - Attribute: DW_AT_high_pc
1248bb4451aSAlexey Lapshin            Form:      DW_FORM_data8
1258bb4451aSAlexey Lapshin          - Attribute: DW_AT_type
1268bb4451aSAlexey Lapshin            Form:      DW_FORM_ref4
1278bb4451aSAlexey Lapshin      - Tag:      DW_TAG_class_type
1288bb4451aSAlexey Lapshin        Children: DW_CHILDREN_yes
1298bb4451aSAlexey Lapshin        Attributes:
1308bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
1318bb4451aSAlexey Lapshin            Form:      DW_FORM_string
1328bb4451aSAlexey Lapshin      - Tag:      DW_TAG_member
1338bb4451aSAlexey Lapshin        Children: DW_CHILDREN_no
1348bb4451aSAlexey Lapshin        Attributes:
1358bb4451aSAlexey Lapshin          - Attribute: DW_AT_type
1368bb4451aSAlexey Lapshin            Form:      DW_FORM_ref4
1378bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
1388bb4451aSAlexey Lapshin            Form:      DW_FORM_string
1398bb4451aSAlexey Lapshin      - Tag:      DW_TAG_class_type
1408bb4451aSAlexey Lapshin        Children: DW_CHILDREN_no
1418bb4451aSAlexey Lapshin        Attributes:
1428bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
1438bb4451aSAlexey Lapshin            Form:      DW_FORM_string
1448bb4451aSAlexey Lapshin          - Attribute: DW_AT_declaration
1458bb4451aSAlexey Lapshin            Form:      DW_FORM_flag_present
1468bb4451aSAlexey Lapshin      - Tag:      DW_TAG_class_type
1478bb4451aSAlexey Lapshin        Children: DW_CHILDREN_yes
1488bb4451aSAlexey Lapshin        Attributes:
1498bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
1508bb4451aSAlexey Lapshin            Form:      DW_FORM_string
1518bb4451aSAlexey Lapshin          - Attribute: DW_AT_declaration
1528bb4451aSAlexey Lapshin            Form:      DW_FORM_flag_present
1538bb4451aSAlexey Lapshin      - Tag:      DW_TAG_template_type_parameter
1548bb4451aSAlexey Lapshin        Children: DW_CHILDREN_no
1558bb4451aSAlexey Lapshin        Attributes:
1568bb4451aSAlexey Lapshin          - Attribute: DW_AT_type
1578bb4451aSAlexey Lapshin            Form:      DW_FORM_ref4
1588bb4451aSAlexey Lapshin      - Tag:      DW_TAG_base_type
1598bb4451aSAlexey Lapshin        Children: DW_CHILDREN_no
1608bb4451aSAlexey Lapshin        Attributes:
1618bb4451aSAlexey Lapshin          - Attribute: DW_AT_name
1628bb4451aSAlexey Lapshin            Form:      DW_FORM_string
1638bb4451aSAlexey Lapshin  debug_info:
1648bb4451aSAlexey Lapshin    - Version: 4
1658bb4451aSAlexey Lapshin      Entries:
1668bb4451aSAlexey Lapshin        - AbbrCode: 1
1678bb4451aSAlexey Lapshin          Values:
1688bb4451aSAlexey Lapshin            - CStr: by_hand
1698bb4451aSAlexey Lapshin            - Value:  0x04
1708bb4451aSAlexey Lapshin            - CStr: CU1
1718bb4451aSAlexey Lapshin            - Value:  0x1000
1728bb4451aSAlexey Lapshin            - Value:  0x1b
1738bb4451aSAlexey Lapshin        - AbbrCode: 3
1748bb4451aSAlexey Lapshin          Values:
1758bb4451aSAlexey Lapshin            - CStr: class1
1768bb4451aSAlexey Lapshin        - AbbrCode: 4
1778bb4451aSAlexey Lapshin          Values:
1788bb4451aSAlexey Lapshin            - Value:  0x0000006c
1798bb4451aSAlexey Lapshin            - CStr: member1
1808bb4451aSAlexey Lapshin        - AbbrCode: 0
1818bb4451aSAlexey Lapshin        - AbbrCode: 3
1828bb4451aSAlexey Lapshin          Values:
1838bb4451aSAlexey Lapshin            - CStr: class2
1848bb4451aSAlexey Lapshin        - AbbrCode: 4
1858bb4451aSAlexey Lapshin          Values:
1868bb4451aSAlexey Lapshin            - Value:  0x0000006c
1878bb4451aSAlexey Lapshin            - CStr: member1
1888bb4451aSAlexey Lapshin        - AbbrCode: 0
1898bb4451aSAlexey Lapshin        - AbbrCode: 3
1908bb4451aSAlexey Lapshin          Values:
1918bb4451aSAlexey Lapshin            - CStr: class3
1928bb4451aSAlexey Lapshin        - AbbrCode: 4
1938bb4451aSAlexey Lapshin          Values:
1948bb4451aSAlexey Lapshin            - Value:  0x0000006c
1958bb4451aSAlexey Lapshin            - CStr: member1
1968bb4451aSAlexey Lapshin        - AbbrCode: 0
1978bb4451aSAlexey Lapshin        - AbbrCode: 8
1988bb4451aSAlexey Lapshin          Values:
1998bb4451aSAlexey Lapshin            - CStr: int
2008bb4451aSAlexey Lapshin        - AbbrCode: 2
2018bb4451aSAlexey Lapshin          Values:
2028bb4451aSAlexey Lapshin            - CStr: foo1
2038bb4451aSAlexey Lapshin            - Value:  0x1000
2048bb4451aSAlexey Lapshin            - Value:  0x10
2058bb4451aSAlexey Lapshin            - Value:  0x0000002a
2068bb4451aSAlexey Lapshin        - AbbrCode: 0
2078bb4451aSAlexey Lapshin    - Version: 4
2088bb4451aSAlexey Lapshin      Entries:
2098bb4451aSAlexey Lapshin        - AbbrCode: 1
2108bb4451aSAlexey Lapshin          Values:
2118bb4451aSAlexey Lapshin            - CStr: by_hand
2128bb4451aSAlexey Lapshin            - Value:  0x04
2138bb4451aSAlexey Lapshin            - CStr: CU1
2148bb4451aSAlexey Lapshin            - Value:  0x1000
2158bb4451aSAlexey Lapshin            - Value:  0x1b
2168bb4451aSAlexey Lapshin        - AbbrCode: 3
2178bb4451aSAlexey Lapshin          Values:
2188bb4451aSAlexey Lapshin            - CStr: class1
2198bb4451aSAlexey Lapshin        - AbbrCode: 4
2208bb4451aSAlexey Lapshin          Values:
2218bb4451aSAlexey Lapshin            - Value:  0x0000006c
2228bb4451aSAlexey Lapshin            - CStr: member1
2238bb4451aSAlexey Lapshin        - AbbrCode: 0
2248bb4451aSAlexey Lapshin        - AbbrCode: 3
2258bb4451aSAlexey Lapshin          Values:
2268bb4451aSAlexey Lapshin            - CStr: class2
2278bb4451aSAlexey Lapshin        - AbbrCode: 4
2288bb4451aSAlexey Lapshin          Values:
2298bb4451aSAlexey Lapshin            - Value:  0x0000006c
2308bb4451aSAlexey Lapshin            - CStr: member1
2318bb4451aSAlexey Lapshin        - AbbrCode: 0
2328bb4451aSAlexey Lapshin        - AbbrCode: 3
2338bb4451aSAlexey Lapshin          Values:
2348bb4451aSAlexey Lapshin            - CStr: class3
2358bb4451aSAlexey Lapshin        - AbbrCode: 4
2368bb4451aSAlexey Lapshin          Values:
2378bb4451aSAlexey Lapshin            - Value:  0x0000006c
2388bb4451aSAlexey Lapshin            - CStr: member1
2398bb4451aSAlexey Lapshin        - AbbrCode: 0
2408bb4451aSAlexey Lapshin        - AbbrCode: 8
2418bb4451aSAlexey Lapshin          Values:
2428bb4451aSAlexey Lapshin            - CStr: int
2438bb4451aSAlexey Lapshin        - AbbrCode: 2
2448bb4451aSAlexey Lapshin          Values:
2458bb4451aSAlexey Lapshin            - CStr: foo2
2468bb4451aSAlexey Lapshin            - Value:  0x1000
2478bb4451aSAlexey Lapshin            - Value:  0x10
2488bb4451aSAlexey Lapshin            - Value:  0x00000040
2498bb4451aSAlexey Lapshin        - AbbrCode: 0
2508bb4451aSAlexey Lapshin...
251