Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/ObjectYAML/MachO/DWARF-debug_abbrev.yaml
# RUN: yaml2obj %s | obj2yaml | FileCheck %s | ## a) Test that yaml2obj is able to emit the __debug_abbrev section and obj2yaml is | ||||
## able to convert it back. | |||||
# RUN: yaml2obj --docnum=1 %s | obj2yaml | FileCheck %s | |||||
--- !mach-o | --- !mach-o | ||||
FileHeader: | FileHeader: | ||||
magic: 0xFEEDFACF | magic: 0xFEEDFACF | ||||
cputype: 0x01000007 | cputype: 0x01000007 | ||||
cpusubtype: 0x00000003 | cpusubtype: 0x00000003 | ||||
filetype: 0x0000000A | filetype: 0x0000000A | ||||
ncmds: 5 | ncmds: 5 | ||||
▲ Show 20 Lines • Show All 405 Lines • ▼ Show 20 Lines | |||||
#CHECK: - Attribute: DW_AT_byte_size | #CHECK: - Attribute: DW_AT_byte_size | ||||
#CHECK: Form: DW_FORM_data1 | #CHECK: Form: DW_FORM_data1 | ||||
#CHECK: - Code: 0x0000000000000005 | #CHECK: - Code: 0x0000000000000005 | ||||
#CHECK: Tag: DW_TAG_pointer_type | #CHECK: Tag: DW_TAG_pointer_type | ||||
#CHECK: Children: DW_CHILDREN_no | #CHECK: Children: DW_CHILDREN_no | ||||
#CHECK: Attributes: | #CHECK: Attributes: | ||||
#CHECK: - Attribute: DW_AT_type | #CHECK: - Attribute: DW_AT_type | ||||
#CHECK: Form: DW_FORM_ref4 | #CHECK: Form: DW_FORM_ref4 | ||||
Higuoxing: I will remove this blank line later. | |||||
## b) Test that yaml2obj emits an error message when there are non-empty compilation | |||||
## units and multiple abbrev tables are assigned the same ID. | |||||
# RUN: not yaml2obj --docnum=2 %s 2>&1 | FileCheck %s --check-prefix=ID-COLLISION | |||||
# ID-COLLISION: yaml2obj: error: the ID (1) of abbrev table with index 1 has been used by abbrev table with index 0 | |||||
--- !mach-o | |||||
FileHeader: | |||||
magic: 0xFEEDFACF | |||||
cputype: 0x01000007 | |||||
cpusubtype: 0x00000003 | |||||
filetype: 0x0000000A | |||||
ncmds: 1 | |||||
sizeofcmds: 232 | |||||
flags: 0x00000000 | |||||
reserved: 0x00000000 | |||||
LoadCommands: | |||||
- cmd: LC_SEGMENT_64 | |||||
cmdsize: 232 | |||||
segname: __DWARF | |||||
vmaddr: 0x00 | |||||
vmsize: 0x00 | |||||
fileoff: 0x00 | |||||
filesize: 0x00 | |||||
maxprot: 0 | |||||
initprot: 0 | |||||
nsects: 2 | |||||
flags: 0 | |||||
Sections: | |||||
- sectname: __debug_abbrev | |||||
segname: __DWARF | |||||
addr: 0x00 | |||||
size: 24 | |||||
offset: 528 | |||||
align: 0 | |||||
reloff: 0x00000000 | |||||
nreloc: 0 | |||||
flags: 0x00000000 | |||||
reserved1: 0x00000000 | |||||
reserved2: 0x00000000 | |||||
reserved3: 0x00000000 | |||||
- sectname: __debug_info | |||||
segname: __DWARF | |||||
addr: 0x00 | |||||
size: 64 | |||||
offset: 1070 | |||||
align: 0 | |||||
reloff: 0x00000000 | |||||
nreloc: 0 | |||||
flags: 0x00000000 | |||||
reserved1: 0x00000000 | |||||
reserved2: 0x00000000 | |||||
reserved3: 0x00000000 | |||||
DWARF: | |||||
debug_abbrev: | |||||
- ID: 1 | |||||
- ID: 1 | |||||
debug_info: | |||||
- Version: 4 | |||||
AbbrOffset: 0x00 | |||||
Entries: | |||||
- AbbrCode: 1 | |||||
Values: | |||||
- Value: 0x1234 |
I will remove this blank line later.