xref: /aosp_15_r20/external/emboss/testdata/explicit_sizes.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-- Test structs for arrays of Ints, UInts, and enums.
16# TODO(bolms): Arrays of bit-level entities directly in structs.
17
18[$default byte_order: "LittleEndian"]
19[(cpp) namespace: "emboss::test"]
20
21
22bits SizedUIntArrays:
23  0  [+8]   UInt:4[2]   one_nibble
24  8  [+16]  UInt:8[2]   two_nibble
25  24 [+32]  UInt:16[2]  four_nibble
26
27
28bits SizedIntArrays:
29  0  [+8]   Int:4[2]   one_nibble
30  8  [+16]  Int:8[2]   two_nibble
31  24 [+32]  Int:16[2]  four_nibble
32
33
34bits SizedEnumArrays:
35  0  [+8]   Enum:4[2]   one_nibble
36  8  [+16]  Enum:8[2]   two_nibble
37  24 [+32]  Enum:16[2]  four_nibble
38
39
40struct BitArrayContainer:
41  0 [+7]  SizedUIntArrays  uint_arrays
42
43
44enum Enum:
45  VALUE1        = 1
46  VALUE10       = 10
47  VALUE100      = 100
48  VALUE1000     = 1000
49  VALUE10000    = 10000
50  VALUE100000   = 100000
51  VALUE1000000  = 1000000
52  VALUE10000000 = 10000000
53