diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-12-28 11:36:49 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-02-19 11:54:01 +0000 |
| commit | bde8fd413bd79491702c8ff7103f5069745574e9 (patch) | |
| tree | 3031745ef1ea67e50c16d94446246aed20a50fd4 /pkg/compiler/testdata/all.txt | |
| parent | 96e91f576713f6e6c16c05f3d1c8130bf5976dc3 (diff) | |
pkg/compiler: extend parent reference support in len
Earlier only len[parent, T] was supported and meant the size of the
whole structure.
Logically, len[parent:b, T] should be equivalent to just len[b, T].
Let len[parent:parent:a, T] refer to the structure that encloses the
current one.
Support len fields inside unions.
Diffstat (limited to 'pkg/compiler/testdata/all.txt')
| -rw-r--r-- | pkg/compiler/testdata/all.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt index edf4bd896..f7639c761 100644 --- a/pkg/compiler/testdata/all.txt +++ b/pkg/compiler/testdata/all.txt @@ -95,6 +95,7 @@ len_expr2 { f23 ptr[in, len_expr4] f24 ptr[in, ptr[in, len_expr4]] f25 len[f21:f31, int32] + f26 len_union } len_expr3 { @@ -112,6 +113,11 @@ len_expr4 { f41 int32 } +len_union [ + u1 len[parent:parent:f21:f31, int32] + u2 int32 +] + foo_len_expr(a ptr[in, len_expr1], b ptr[in, array[int8, 3]]) # Pointer type. @@ -342,4 +348,4 @@ union_compressed [ compressed$1(a compressed_image) (no_generate, no_minimize) compressed$2(a ptr[in, compressed_image]) (no_generate, no_minimize) compressed$3(a ptr[in, struct_compressed]) (no_generate, no_minimize) -compressed$4(a ptr[in, union_compressed]) (no_generate, no_minimize)
\ No newline at end of file +compressed$4(a ptr[in, union_compressed]) (no_generate, no_minimize) |
