xref: /aosp_15_r20/external/emboss/testdata/alignments.emb (revision 99e0aae7469b87d12f0ad23e61142c2d74c1ef70)
1# Copyright 2019 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15-- Structures which can be used be test code to check that alignment
16-- information is properly propagated through Emboss views.
17
18[$default byte_order: "BigEndian"]
19[(cpp) namespace: "emboss::test"]
20
21
22struct Alignments:
23  0  [+4]   Placeholder4     zero_offset
24  0  [+6]   Placeholder6     zero_offset_substructure
25  2  [+6]   Placeholder6     two_offset_substructure
26  3  [+4]   Placeholder4     three_offset
27  4  [+4]   Placeholder4     four_offset
28  11 [+4]   Placeholder4     eleven_offset
29  12 [+4]   Placeholder4     twelve_offset
30  0  [+12]  Placeholder4[3]  zero_offset_four_stride_array
31  0  [+24]  Placeholder6[4]  zero_offset_six_stride_array
32  3  [+12]  Placeholder4[3]  three_offset_four_stride_array
33  4  [+24]  Placeholder6[4]  four_offset_six_stride_array
34
35
36struct Placeholder4:
37  -- Four-byte structure used as a byte-oriented placeholder so that type
38  -- alignment can be tested without any of the bit/byte interface types.
39  0 [+4]  UInt  dummy
40
41
42struct Placeholder6:
43  -- Six-byte structure.  Includes Placeholder4 so that substructure alignments
44  -- can be checked.
45  0 [+4]  Placeholder4  zero_offset
46  2 [+4]  Placeholder4  two_offset
47