diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-01-17 13:16:29 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-02-19 11:54:01 +0000 |
| commit | 8cb16e665dbb5f87aa58856049c1ad6067dc6293 (patch) | |
| tree | cb8eacf9619ce1ea3df3aa5891cf6ab44ebf83b8 /sys/test | |
| parent | 0936819b9f980bde731cb6191677f9aa2cbfd9aa (diff) | |
prog: handle multiple matching union fields
If conditions of several union fields are satisfied, select one
randomly. This would be a more logical semantics.
When conditional struct fields are translated to unions, negate the
condition for the union alternative.
Diffstat (limited to 'sys/test')
| -rw-r--r-- | sys/test/expressions.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/test/expressions.txt b/sys/test/expressions.txt index c99c1364b..16d5b96a7 100644 --- a/sys/test/expressions.txt +++ b/sys/test/expressions.txt @@ -56,3 +56,15 @@ conditional_struct_minimize { } [packed] test$conditional_struct_minimize(a ptr[in, conditional_struct_minimize]) + +conditional_union [ + u1 int8 (if[value[conditional_union_parent:f1] == 0]) + u2 int8 +] + +conditional_union_parent { + f1 int8:1 + f2 conditional_union +} + +test$conditional_union(a ptr[in, conditional_union_parent]) |
