111e05005SAlexey Lapshin## This test checks DWARFv4 DW_MACINFO_start_file 211e05005SAlexey Lapshin## , DW_MACINFO_end_file, DW_MACINFO_define, 311e05005SAlexey Lapshin## DW_MACINFO_UNDEF attributes. 411e05005SAlexey Lapshin 511e05005SAlexey Lapshin# RUN: yaml2obj %s -o %t.o 611e05005SAlexey Lapshin# RUN: llvm-dwarfutil %t.o %t1 711e05005SAlexey Lapshin# RUN: llvm-dwarfdump --verify %t1 | FileCheck --check-prefix=VERIFY %s 811e05005SAlexey Lapshin# RUN: llvm-dwarfdump -a %t1 | FileCheck %s 911e05005SAlexey Lapshin 10*f1fdfe68SAlexey Lapshin# RUN: llvm-dwarfutil --linker parallel %t.o %t1 115f2a7fa6SAlexey Lapshin# RUN: llvm-dwarfdump --verify %t1 | FileCheck --check-prefix=VERIFY %s 125f2a7fa6SAlexey Lapshin# RUN: llvm-dwarfdump -a %t1 | FileCheck %s 135f2a7fa6SAlexey Lapshin 1411e05005SAlexey Lapshin# VERIFY: No errors. 1511e05005SAlexey Lapshin 1611e05005SAlexey Lapshin## Content: "03000201064400020744000400": 1711e05005SAlexey Lapshin# 1811e05005SAlexey Lapshin## .byte 3 # DW_MACINFO_start_file 1911e05005SAlexey Lapshin## .byte 0 # Line Number 2011e05005SAlexey Lapshin## .byte 2 # File Number 2111e05005SAlexey Lapshin## .byte 1 # DW_MACINFO_define 2211e05005SAlexey Lapshin## .byte 6 # Line Number 2311e05005SAlexey Lapshin## .asciz "D" # Macro String 2411e05005SAlexey Lapshin## .byte 2 # DW_MACINFO_undef 2511e05005SAlexey Lapshin## .byte 7 # Line Number 2611e05005SAlexey Lapshin## .asciz "D" # Macro String 2711e05005SAlexey Lapshin## .byte 4 # DW_MACINFO_end_file 2811e05005SAlexey Lapshin## .byte 0 # End Of Macro List Mark 2911e05005SAlexey Lapshin 3011e05005SAlexey Lapshin#CHECK: .debug_info contents: 3111e05005SAlexey Lapshin#CHECK: DW_TAG_compile_unit 3211e05005SAlexey Lapshin#CHECK: DW_AT_name ("CU1") 3311e05005SAlexey Lapshin#CHECK: DW_AT_macro_info (0x00000000) 3411e05005SAlexey Lapshin#CHECK: .debug_macinfo contents: 3511e05005SAlexey Lapshin#CHECK: 0x00000000: 3611e05005SAlexey Lapshin#CHECK: DW_MACINFO_start_file - lineno: 0 filenum: 2 3711e05005SAlexey Lapshin#CHECK: DW_MACINFO_define - lineno: 6 macro: D 3811e05005SAlexey Lapshin#CHECK: DW_MACINFO_undef - lineno: 7 macro: D 3911e05005SAlexey Lapshin#CHECK: DW_MACINFO_end_file 4011e05005SAlexey Lapshin 4111e05005SAlexey Lapshin--- !ELF 4211e05005SAlexey LapshinFileHeader: 4311e05005SAlexey Lapshin Class: ELFCLASS64 4411e05005SAlexey Lapshin Data: ELFDATA2LSB 4511e05005SAlexey Lapshin Type: ET_REL 4611e05005SAlexey Lapshin Machine: EM_X86_64 4711e05005SAlexey LapshinSections: 4811e05005SAlexey Lapshin - Name: .text 4911e05005SAlexey Lapshin Type: SHT_PROGBITS 5011e05005SAlexey Lapshin Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 5111e05005SAlexey Lapshin Address: 0x1000 5211e05005SAlexey Lapshin Size: 0x1b 5311e05005SAlexey Lapshin - Name: .debug_macinfo 5411e05005SAlexey Lapshin Type: SHT_PROGBITS 5511e05005SAlexey Lapshin Flags: [ ] 5611e05005SAlexey Lapshin Content: "03000201064400020744000400" 5711e05005SAlexey LapshinDWARF: 5811e05005SAlexey Lapshin debug_abbrev: 5911e05005SAlexey Lapshin - Table: 6011e05005SAlexey Lapshin - Tag: DW_TAG_compile_unit 6111e05005SAlexey Lapshin Children: DW_CHILDREN_yes 6211e05005SAlexey Lapshin Attributes: 6311e05005SAlexey Lapshin - Attribute: DW_AT_producer 6411e05005SAlexey Lapshin Form: DW_FORM_string 6511e05005SAlexey Lapshin - Attribute: DW_AT_language 6611e05005SAlexey Lapshin Form: DW_FORM_data2 6711e05005SAlexey Lapshin - Attribute: DW_AT_name 6811e05005SAlexey Lapshin Form: DW_FORM_string 6911e05005SAlexey Lapshin - Attribute: DW_AT_low_pc 7011e05005SAlexey Lapshin Form: DW_FORM_addr 7111e05005SAlexey Lapshin - Attribute: DW_AT_high_pc 7211e05005SAlexey Lapshin Form: DW_FORM_data8 7311e05005SAlexey Lapshin - Attribute: DW_AT_macro_info 7411e05005SAlexey Lapshin Form: DW_FORM_sec_offset 7511e05005SAlexey Lapshin - Tag: DW_TAG_class_type 7611e05005SAlexey Lapshin Children: DW_CHILDREN_yes 7711e05005SAlexey Lapshin Attributes: 7811e05005SAlexey Lapshin - Attribute: DW_AT_name 7911e05005SAlexey Lapshin Form: DW_FORM_string 8011e05005SAlexey Lapshin - Tag: DW_TAG_member 8111e05005SAlexey Lapshin Children: DW_CHILDREN_no 8211e05005SAlexey Lapshin Attributes: 8311e05005SAlexey Lapshin - Attribute: DW_AT_type 8411e05005SAlexey Lapshin Form: DW_FORM_ref4 8511e05005SAlexey Lapshin - Attribute: DW_AT_name 8611e05005SAlexey Lapshin Form: DW_FORM_string 8711e05005SAlexey Lapshin - Tag: DW_TAG_class_type 8811e05005SAlexey Lapshin Children: DW_CHILDREN_no 8911e05005SAlexey Lapshin Attributes: 9011e05005SAlexey Lapshin - Attribute: DW_AT_name 9111e05005SAlexey Lapshin Form: DW_FORM_string 9211e05005SAlexey Lapshin - Attribute: DW_AT_declaration 9311e05005SAlexey Lapshin Form: DW_FORM_flag_present 9411e05005SAlexey Lapshin - Tag: DW_TAG_class_type 9511e05005SAlexey Lapshin Children: DW_CHILDREN_yes 9611e05005SAlexey Lapshin Attributes: 9711e05005SAlexey Lapshin - Attribute: DW_AT_name 9811e05005SAlexey Lapshin Form: DW_FORM_string 9911e05005SAlexey Lapshin - Attribute: DW_AT_declaration 10011e05005SAlexey Lapshin Form: DW_FORM_flag_present 10111e05005SAlexey Lapshin - Tag: DW_TAG_template_type_parameter 10211e05005SAlexey Lapshin Children: DW_CHILDREN_no 10311e05005SAlexey Lapshin Attributes: 10411e05005SAlexey Lapshin - Attribute: DW_AT_type 10511e05005SAlexey Lapshin Form: DW_FORM_ref4 10611e05005SAlexey Lapshin - Tag: DW_TAG_base_type 10711e05005SAlexey Lapshin Children: DW_CHILDREN_no 10811e05005SAlexey Lapshin Attributes: 10911e05005SAlexey Lapshin - Attribute: DW_AT_name 11011e05005SAlexey Lapshin Form: DW_FORM_string 11111e05005SAlexey Lapshin - Tag: DW_TAG_pointer_type 11211e05005SAlexey Lapshin Children: DW_CHILDREN_no 11311e05005SAlexey Lapshin Attributes: 11411e05005SAlexey Lapshin - Attribute: DW_AT_type 11511e05005SAlexey Lapshin Form: DW_FORM_ref4 11611e05005SAlexey Lapshin - Tag: DW_TAG_variable 11711e05005SAlexey Lapshin Children: DW_CHILDREN_no 11811e05005SAlexey Lapshin Attributes: 11911e05005SAlexey Lapshin - Attribute: DW_AT_name 12011e05005SAlexey Lapshin Form: DW_FORM_string 12111e05005SAlexey Lapshin - Attribute: DW_AT_const_value 12211e05005SAlexey Lapshin Form: DW_FORM_data4 12311e05005SAlexey Lapshin - Attribute: DW_AT_type 12411e05005SAlexey Lapshin Form: DW_FORM_ref4 12511e05005SAlexey Lapshin - Tag: DW_TAG_subprogram 12611e05005SAlexey Lapshin Children: DW_CHILDREN_no 12711e05005SAlexey Lapshin Attributes: 12811e05005SAlexey Lapshin - Attribute: DW_AT_name 12911e05005SAlexey Lapshin Form: DW_FORM_string 13011e05005SAlexey Lapshin - Attribute: DW_AT_low_pc 13111e05005SAlexey Lapshin Form: DW_FORM_addr 13211e05005SAlexey Lapshin - Attribute: DW_AT_high_pc 13311e05005SAlexey Lapshin Form: DW_FORM_data8 13411e05005SAlexey Lapshin - Attribute: DW_AT_type 13511e05005SAlexey Lapshin Form: DW_FORM_ref4 13611e05005SAlexey Lapshin debug_info: 13711e05005SAlexey Lapshin - Version: 4 13811e05005SAlexey Lapshin Entries: 13911e05005SAlexey Lapshin - AbbrCode: 1 14011e05005SAlexey Lapshin Values: 14111e05005SAlexey Lapshin - CStr: by_hand 14211e05005SAlexey Lapshin - Value: 0x04 14311e05005SAlexey Lapshin - CStr: CU1 14411e05005SAlexey Lapshin - Value: 0x1000 14511e05005SAlexey Lapshin - Value: 0x1b 14611e05005SAlexey Lapshin - Value: 0x0 14711e05005SAlexey Lapshin - AbbrCode: 2 14811e05005SAlexey Lapshin Values: 14911e05005SAlexey Lapshin - CStr: class1 15011e05005SAlexey Lapshin - AbbrCode: 3 15111e05005SAlexey Lapshin Values: 15211e05005SAlexey Lapshin - Value: 0x00000051 15311e05005SAlexey Lapshin - CStr: member1 15411e05005SAlexey Lapshin - AbbrCode: 3 15511e05005SAlexey Lapshin Values: 15611e05005SAlexey Lapshin - Value: 0x00000056 15711e05005SAlexey Lapshin - CStr: member2 15811e05005SAlexey Lapshin - AbbrCode: 0 15911e05005SAlexey Lapshin - AbbrCode: 7 16011e05005SAlexey Lapshin Values: 16111e05005SAlexey Lapshin - CStr: int 16211e05005SAlexey Lapshin - AbbrCode: 7 16311e05005SAlexey Lapshin Values: 16411e05005SAlexey Lapshin - CStr: char 16511e05005SAlexey Lapshin - AbbrCode: 7 16611e05005SAlexey Lapshin Values: 16711e05005SAlexey Lapshin - CStr: float 16811e05005SAlexey Lapshin - AbbrCode: 8 16911e05005SAlexey Lapshin Values: 17011e05005SAlexey Lapshin - Value: 0x0000002a 17111e05005SAlexey Lapshin - AbbrCode: 9 17211e05005SAlexey Lapshin Values: 17311e05005SAlexey Lapshin - CStr: var1 17411e05005SAlexey Lapshin - Value: 0x00000000 17511e05005SAlexey Lapshin - Value: 0x00000051 17611e05005SAlexey Lapshin - AbbrCode: 10 17711e05005SAlexey Lapshin Values: 17811e05005SAlexey Lapshin - CStr: foo1 17911e05005SAlexey Lapshin - Value: 0x1000 18011e05005SAlexey Lapshin - Value: 0x10 18111e05005SAlexey Lapshin - Value: 0x0000002e 18211e05005SAlexey Lapshin - AbbrCode: 0 18311e05005SAlexey Lapshin - AbbrCode: 0 18411e05005SAlexey Lapshin... 185