xref: /llvm-project/llvm/test/tools/llvm-dwarfutil/ELF/X86/gc-no-garbage.test (revision f1fdfe6888f93b9f6dfb4689e1f3206de584ff5b)
14539b441SAlexey Lapshin## This test checks that debug info removal optimization (--garbage-collection)
24539b441SAlexey Lapshin## does not affect files which do not have dead debug info.
34539b441SAlexey Lapshin
44539b441SAlexey Lapshin# RUN: yaml2obj %s -o %t.o
5b61ac4a8Savl-llvm# RUN: llvm-dwarfutil --no-odr --tombstone=maxpc --garbage-collection %t.o - | llvm-dwarfdump -a - | FileCheck %s
64539b441SAlexey Lapshin
7*f1fdfe68SAlexey Lapshin# RUN: llvm-dwarfutil --no-odr --linker parallel --tombstone=maxpc --garbage-collection %t.o - | llvm-dwarfdump -a - | FileCheck %s
85f2a7fa6SAlexey Lapshin
94539b441SAlexey Lapshin# CHECK: DW_TAG_compile_unit
104539b441SAlexey Lapshin# CHECK: DW_AT_name{{.*}}"CU1"
114539b441SAlexey Lapshin# CHECK: DW_TAG_class_type
124539b441SAlexey Lapshin# CHECK: DW_AT_name{{.*}}"class1"
134539b441SAlexey Lapshin# CHECK: DW_TAG_class_type
144539b441SAlexey Lapshin# CHECK: "class2"
154539b441SAlexey Lapshin# CHECK: DW_TAG_subprogram
164539b441SAlexey Lapshin# CHECK: DW_AT_name{{.*}}"foo1"
174539b441SAlexey Lapshin# CHECK: DW_AT_low_pc{{.*}}0x0000000000001000
184539b441SAlexey Lapshin# CHECK: DW_AT_high_pc{{.*}}0x0000000000001010
194539b441SAlexey Lapshin# CHECK: DW_AT_type{{.*}}"class1"
204539b441SAlexey Lapshin# CHECK: DW_TAG_subprogram
214539b441SAlexey Lapshin# CHECK: "foo2"
224539b441SAlexey Lapshin# CHECK: DW_AT_low_pc{{.*}}0x0000000000001010
234539b441SAlexey Lapshin# CHECK: DW_AT_high_pc{{.*}}0x000000000000101b
244539b441SAlexey Lapshin# CHECK: DW_AT_type{{.*}}"class2"
254539b441SAlexey Lapshin
264539b441SAlexey Lapshin
274539b441SAlexey Lapshin--- !ELF
284539b441SAlexey LapshinFileHeader:
294539b441SAlexey Lapshin  Class:    ELFCLASS64
304539b441SAlexey Lapshin  Data:     ELFDATA2LSB
314539b441SAlexey Lapshin  Type:     ET_REL
324539b441SAlexey Lapshin  Machine:  EM_X86_64
334539b441SAlexey LapshinSections:
344539b441SAlexey Lapshin  - Name:            .text
354539b441SAlexey Lapshin    Type:            SHT_PROGBITS
364539b441SAlexey Lapshin    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
374539b441SAlexey Lapshin    Address:         0x1000
384539b441SAlexey Lapshin    Size:            0x1b
394539b441SAlexey LapshinDWARF:
404539b441SAlexey Lapshin  debug_abbrev:
414539b441SAlexey Lapshin    - Table:
424539b441SAlexey Lapshin      - Tag:      DW_TAG_compile_unit
434539b441SAlexey Lapshin        Children: DW_CHILDREN_yes
444539b441SAlexey Lapshin        Attributes:
454539b441SAlexey Lapshin          - Attribute: DW_AT_producer
464539b441SAlexey Lapshin            Form:      DW_FORM_string
474539b441SAlexey Lapshin          - Attribute: DW_AT_language
484539b441SAlexey Lapshin            Form:      DW_FORM_data2
494539b441SAlexey Lapshin          - Attribute: DW_AT_name
504539b441SAlexey Lapshin            Form:      DW_FORM_string
514539b441SAlexey Lapshin          - Attribute: DW_AT_low_pc
524539b441SAlexey Lapshin            Form:      DW_FORM_addr
534539b441SAlexey Lapshin          - Attribute: DW_AT_high_pc
544539b441SAlexey Lapshin            Form:      DW_FORM_data8
554539b441SAlexey Lapshin      - Tag:      DW_TAG_subprogram
564539b441SAlexey Lapshin        Children: DW_CHILDREN_no
574539b441SAlexey Lapshin        Attributes:
584539b441SAlexey Lapshin          - Attribute: DW_AT_name
594539b441SAlexey Lapshin            Form:      DW_FORM_string
604539b441SAlexey Lapshin          - Attribute: DW_AT_low_pc
614539b441SAlexey Lapshin            Form:      DW_FORM_addr
624539b441SAlexey Lapshin          - Attribute: DW_AT_high_pc
634539b441SAlexey Lapshin            Form:      DW_FORM_data8
644539b441SAlexey Lapshin          - Attribute: DW_AT_type
654539b441SAlexey Lapshin            Form:      DW_FORM_ref4
664539b441SAlexey Lapshin      - Tag:      DW_TAG_class_type
674539b441SAlexey Lapshin        Children: DW_CHILDREN_yes
684539b441SAlexey Lapshin        Attributes:
694539b441SAlexey Lapshin          - Attribute: DW_AT_name
704539b441SAlexey Lapshin            Form:      DW_FORM_string
714539b441SAlexey Lapshin      - Tag:      DW_TAG_member
724539b441SAlexey Lapshin        Children: DW_CHILDREN_no
734539b441SAlexey Lapshin        Attributes:
744539b441SAlexey Lapshin          - Attribute: DW_AT_type
754539b441SAlexey Lapshin            Form:      DW_FORM_ref4
764539b441SAlexey Lapshin          - Attribute: DW_AT_name
774539b441SAlexey Lapshin            Form:      DW_FORM_string
784539b441SAlexey Lapshin      - Tag:      DW_TAG_class_type
794539b441SAlexey Lapshin        Children: DW_CHILDREN_no
804539b441SAlexey Lapshin        Attributes:
814539b441SAlexey Lapshin          - Attribute: DW_AT_name
824539b441SAlexey Lapshin            Form:      DW_FORM_string
834539b441SAlexey Lapshin          - Attribute: DW_AT_declaration
844539b441SAlexey Lapshin            Form:      DW_FORM_flag_present
854539b441SAlexey Lapshin      - Tag:      DW_TAG_class_type
864539b441SAlexey Lapshin        Children: DW_CHILDREN_yes
874539b441SAlexey Lapshin        Attributes:
884539b441SAlexey Lapshin          - Attribute: DW_AT_name
894539b441SAlexey Lapshin            Form:      DW_FORM_string
904539b441SAlexey Lapshin          - Attribute: DW_AT_declaration
914539b441SAlexey Lapshin            Form:      DW_FORM_flag_present
924539b441SAlexey Lapshin      - Tag:      DW_TAG_template_type_parameter
934539b441SAlexey Lapshin        Children: DW_CHILDREN_no
944539b441SAlexey Lapshin        Attributes:
954539b441SAlexey Lapshin          - Attribute: DW_AT_type
964539b441SAlexey Lapshin            Form:      DW_FORM_ref4
974539b441SAlexey Lapshin      - Tag:      DW_TAG_base_type
984539b441SAlexey Lapshin        Children: DW_CHILDREN_no
994539b441SAlexey Lapshin        Attributes:
1004539b441SAlexey Lapshin          - Attribute: DW_AT_name
1014539b441SAlexey Lapshin            Form:      DW_FORM_string
1024539b441SAlexey Lapshin  debug_info:
1034539b441SAlexey Lapshin    - Version: 4
1044539b441SAlexey Lapshin      Entries:
1054539b441SAlexey Lapshin        - AbbrCode: 1
1064539b441SAlexey Lapshin          Values:
1074539b441SAlexey Lapshin            - CStr: by_hand
1084539b441SAlexey Lapshin            - Value:  0x04
1094539b441SAlexey Lapshin            - CStr: CU1
1104539b441SAlexey Lapshin            - Value:  0x1000
1114539b441SAlexey Lapshin            - Value:  0x1b
1124539b441SAlexey Lapshin        - AbbrCode: 3
1134539b441SAlexey Lapshin          Values:
1144539b441SAlexey Lapshin            - CStr: class1
1154539b441SAlexey Lapshin        - AbbrCode: 4
1164539b441SAlexey Lapshin          Values:
1174539b441SAlexey Lapshin            - Value:  0x00000056
1184539b441SAlexey Lapshin            - CStr: member1
1194539b441SAlexey Lapshin        - AbbrCode: 0
1204539b441SAlexey Lapshin        - AbbrCode: 3
1214539b441SAlexey Lapshin          Values:
1224539b441SAlexey Lapshin            - CStr: class2
1234539b441SAlexey Lapshin        - AbbrCode: 4
1244539b441SAlexey Lapshin          Values:
1254539b441SAlexey Lapshin            - Value:  0x00000056
1264539b441SAlexey Lapshin            - CStr: member1
1274539b441SAlexey Lapshin        - AbbrCode: 0
1284539b441SAlexey Lapshin        - AbbrCode: 8
1294539b441SAlexey Lapshin          Values:
1304539b441SAlexey Lapshin            - CStr: int
1314539b441SAlexey Lapshin        - AbbrCode: 2
1324539b441SAlexey Lapshin          Values:
1334539b441SAlexey Lapshin            - CStr: foo1
1344539b441SAlexey Lapshin            - Value:  0x1000
1354539b441SAlexey Lapshin            - Value:  0x10
1364539b441SAlexey Lapshin            - Value:  0x0000002a
1374539b441SAlexey Lapshin        - AbbrCode: 2
1384539b441SAlexey Lapshin          Values:
1394539b441SAlexey Lapshin            - CStr: foo2
1404539b441SAlexey Lapshin            - Value:  0x1010
1414539b441SAlexey Lapshin            - Value:  0xb
1424539b441SAlexey Lapshin            - Value:  0x00000040
1434539b441SAlexey Lapshin        - AbbrCode: 0
1444539b441SAlexey Lapshin...
145