1 ## Evaluates the hex writer behavior with empty sections and segments.
3 ## Show that the presence of an empty section placed at the same address of a
4 ## filled section doesn't affect the hex output. Also, show that the presence of
5 ## an empty section placed behind the filled section doesn't affect the hex
6 ## output. And, show that this happens regardless of the section ordering in the
7 ## section header table. (Two filled sections, and four empty sections, to
10 ## Then, show the same kind of behaviors for segments. (One filled section, four
11 ## empty sections, each in a single segment.)
13 # RUN: yaml2obj %s -o %t
14 # RUN: llvm-objcopy -O ihex %t - | FileCheck %s --implicit-check-not={{.}}
17 # CHECK: :02000004333394
18 ## .data0 offset, contents, checksum
19 # CHECK-NEXT: :020000000123DA
22 # CHECK-NEXT: :02000004444472
23 ## .data1 offset, contents, checksum
24 # CHECK-NEXT: :02000000456752
27 # CHECK-NEXT: :0200000477770C
28 ## .data2 offset, contents, checksum
29 # CHECK-NEXT: :0200000089ABCA
32 # CHECK-NEXT: :00000001FF
41 ## An empty section that's placed at the same address as a populated section.
42 ## This won't be in the output. It also won't affect how the subsequent section
44 - Name: .empty_at_data0
49 ## A section populated with data. This is in the output.
55 ## An empty section that's placed at the end of .data0. This won't be in the
57 - Name: .empty_behind_data0
62 ## An empty section declared before .data1, but placed behind .data1. This
63 ## won't be in the output.
64 - Name: .empty_behind_data1
69 ## A section populated with data. This is in the output.
75 ## An empty section declared after .data1, but placed at the start of .data1.
76 ## This won't be in the output.
77 - Name: .empty_at_data1
82 ## An empty section that's isolated (by address) from all others. This won't be
84 - Name: .empty_isolated
90 ## The sections below are placed into segments of varying configurations.
91 ## Populated section in its own segment. This is in the output.
97 ## Empty section in its own segment. That segment is declared before the .data2
98 ## segment in the program headers, and placed at an address just behind .data2.
99 ## This won't be in the output.
105 ## Empty section in its own segment. That segment is declared before the .data2
106 ## segment in the program headers, and placed at the same address as .data2.
107 ## This won't be in the output.
113 ## Empty section in its own segment. That segment is declared after the .data2
114 ## segment in the program headers, and placed at the same address as .data2.
115 ## This won't be in the output.
121 ## Empty section in its own segment. That segment is declared after the .data2
122 ## segment in the program headers, and placed at an address just behind .data2.
123 ## This won't be in the output.
130 ## .data0 sections, with empty bookends.
135 FirstSec: .empty_at_data0
136 LastSec: .empty_behind_data0
137 ## .data1 sections, with empty bookends.
142 FirstSec: .empty_behind_data1
143 LastSec: .empty_at_data1
144 ## .empty_isolated section.
149 FirstSec: .empty_isolated
150 LastSec: .empty_isolated
151 ## Segments below include a single empty segment, and are positioned around
152 ## .data2 in various ways. Declared before, placed behind .data2 segment.
159 ## Declared before, placed at .data2 segment.
166 ## Segment for .data2.
173 ## Declared after, placed at .data2 segment.
180 ## Declared after, placed behind .data2 segment.