1 ## a) Test that we are able to dump the __debug_aranges section.
2 ## The content of the __debug_aranges section should be written in
3 ## the "DWARF" entry and the "content" field should remain empty.
5 # RUN: yaml2obj --docnum=1 %s | obj2yaml | FileCheck -DSEGNAME=DWARF %s --check-prefix=ARANGES
8 # ARANGES-NEXT: - sectname: __debug_aranges
9 # ARANGES-NEXT: segname: __[[SEGNAME]]
10 # ARANGES-NEXT: addr: 0x0
11 # ARANGES-NEXT: size: 64
12 # ARANGES-NEXT: offset: 0x210
13 # ARANGES-NEXT: align: 0
14 # ARANGES-NEXT: reloff: 0x0
15 # ARANGES-NEXT: nreloc: 0
16 # ARANGES-NEXT: flags: 0x0
17 # ARANGES-NEXT: reserved1: 0x0
18 # ARANGES-NEXT: reserved2: 0x0
19 # ARANGES-NEXT: reserved3: 0x0
20 # ARANGES-NEXT: DWARF:
21 # ARANGES-NEXT: debug_aranges:
22 # ARANGES-NEXT: - Length: 0x3C
23 # ARANGES-NEXT: Version: 2
24 # ARANGES-NEXT: CuOffset: 0x1234
25 # ARANGES-NEXT: AddressSize: 0x8
26 # ARANGES-NEXT: Descriptors:
27 # ARANGES-NEXT: - Address: 0x1234
28 # ARANGES-NEXT: Length: 0x5678
29 # ARANGES-NEXT: - Address: 0x1234
30 # ARANGES-NEXT: Length: 0x5678
37 cpusubtype: 0x00000003
56 - sectname: __debug_aranges
70 - Length: [[LENGTH=<none>]]
79 ## b) Test dumping a __debug_aranges section whose length field doesn't match the actual length.
80 ## This makes the DWARF parser fail to parse it and we will dump it as a raw content section.
82 # RUN: yaml2obj --docnum=1 -DLENGTH=0x2 %s | obj2yaml | FileCheck %s --check-prefix=RAW-CONTENT
84 # RAW-CONTENT: - sectname: __debug_aranges
85 # RAW-CONTENT-NEXT: segname: __DWARF
86 # RAW-CONTENT-NEXT: addr: 0x0
87 # RAW-CONTENT-NEXT: size: 64
88 # RAW-CONTENT-NEXT: offset: 0x210
89 # RAW-CONTENT-NEXT: align: 0
90 # RAW-CONTENT-NEXT: reloff: 0x0
91 # RAW-CONTENT-NEXT: nreloc: 0
92 # RAW-CONTENT-NEXT: flags: 0x0
93 # RAW-CONTENT-NEXT: reserved1: 0x0
94 # RAW-CONTENT-NEXT: reserved2: 0x0
95 # RAW-CONTENT-NEXT: reserved3: 0x0
96 # RAW-CONTENT-NEXT: content: '02000000020034120000080000000000341200000000000078560000000000003412000000000000785600000000000000000000000000000000000000000000'
97 # RAW-CONTENT-NEXT: ...
99 ## c) Test dumping a __debug_aranges section whose segname is __FOO.
101 # RUN: yaml2obj --docnum=2 %s | obj2yaml | FileCheck %s -DSEGNAME=FOO --check-prefix=ARANGES
108 cpusubtype: 0x00000003
127 - sectname: __debug_aranges
136 reserved1: 0x00000000
137 reserved2: 0x00000000
138 reserved3: 0x00000000
139 content: '3C000000020034120000080000000000341200000000000078560000000000003412000000000000785600000000000000000000000000000000000000000000'