diff options
author | Xing GUO <higuoxing@gmail.com> | 2020-09-09 08:48:04 +0800 |
---|---|---|
committer | Xing GUO <higuoxing@gmail.com> | 2020-09-09 08:48:39 +0800 |
commit | 4682f654031c346106463d37ac44e44b0c9856dc (patch) | |
tree | f025ff50540812782a8dc21914db92cdb8a2ad05 /llvm/test/ObjectYAML/MachO | |
parent | 4013bab9c4a5fe634be6271779a99bc158c3e396 (diff) | |
download | llvm-4682f654031c346106463d37ac44e44b0c9856dc.zip llvm-4682f654031c346106463d37ac44e44b0c9856dc.tar.gz llvm-4682f654031c346106463d37ac44e44b0c9856dc.tar.bz2 |
[obj2yaml][test] Test generating and dumping a broken debug_ranges section.
This patch tests generating and dumping a broken debug_ranges section.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D87275
Diffstat (limited to 'llvm/test/ObjectYAML/MachO')
-rw-r--r-- | llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml b/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml index 30997ba..5aea820 100644 --- a/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml @@ -284,3 +284,27 @@ LoadCommands: reserved2: 0x00000000 reserved3: 0x00000000 content: [[CONTENT=<none>]] + +## Test generating and dumping a __debug_ranges section whose size isn't a +## multiple of the address size. This test case is to ensure that when the +## parser fails, the content of the __debug_ranges section will be dumped into +## the 'content' entry and the 'debug_ranges' entry will not exist. + +# RUN: yaml2obj --docnum=2 -DSIZE=3 -DCONTENT='010203' %s | obj2yaml | FileCheck %s --check-prefix=FAILS + +# FAILS-NOT: DWARF: +# FAILS: Sections: +# FAILS-NEXT: - sectname: __debug_ranges +# FAILS-NEXT: segname: __DWARF +# FAILS-NEXT: addr: 0x0000000000000000 +# FAILS-NEXT: size: 3 +# FAILS-NEXT: offset: 0x00000210 +# FAILS-NEXT: align: 0 +# FAILS-NEXT: reloff: 0x00000000 +# FAILS-NEXT: nreloc: 0 +# FAILS-NEXT: flags: 0x00000000 +# FAILS-NEXT: reserved1: 0x00000000 +# FAILS-NEXT: reserved2: 0x00000000 +# FAILS-NEXT: reserved3: 0x00000000 +# FAILS-NEXT: content: '010203' +# FAILS-NEXT: ... |