diff options
author | Xing GUO <higuoxing@gmail.com> | 2020-09-08 19:55:14 +0800 |
---|---|---|
committer | Xing GUO <higuoxing@gmail.com> | 2020-09-08 19:55:47 +0800 |
commit | 25c3fa3f13336b2da7c63162b0d9da164a0a96a1 (patch) | |
tree | 1978200523dc4c3d08e6a8315b0f9df2c97e5105 /llvm/test/ObjectYAML | |
parent | 847299d3f00507f172097bad9dde61dfad0d355b (diff) | |
download | llvm-25c3fa3f13336b2da7c63162b0d9da164a0a96a1.zip llvm-25c3fa3f13336b2da7c63162b0d9da164a0a96a1.tar.gz llvm-25c3fa3f13336b2da7c63162b0d9da164a0a96a1.tar.bz2 |
[DWARFYAML] Make the debug_ranges section optional.
This patch makes the debug_ranges section optional. When we specify an
empty debug_ranges section, yaml2obj only emits the section header.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D87263
Diffstat (limited to 'llvm/test/ObjectYAML')
-rw-r--r-- | llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml b/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml index 8948bf9..30997ba 100644 --- a/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml @@ -239,3 +239,48 @@ DWARF: - AbbrCode: 0x00000000 Values: [] ... + +## Test generating and dumping an empty __debug_ranges section. + +# RUN: yaml2obj --docnum=2 %s | obj2yaml | FileCheck %s --check-prefix=EMPTY + +# EMPTY: DWARF: +# EMPTY-NEXT: debug_ranges: [] +# EMPTY-NEXT: ... + +--- !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: 152 + segname: __DWARF + vmaddr: 0x00 + vmsize: 0x00 + fileoff: 0x00 + filesize: 0x00 + maxprot: 0 + initprot: 0 + nsects: 1 + flags: 0 + Sections: + - sectname: __debug_ranges + segname: __DWARF + addr: 0x00 + size: [[SIZE=0]] + offset: 0x210 + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: [[CONTENT=<none>]] |