diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-05-16 18:05:05 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-05-16 18:05:05 +0200 |
| commit | 76fc461b55cfe334e8d4be121f61fa25d079f8ba (patch) | |
| tree | 88cc3472e7352c2cd74f3234acb4bd2083ff61d4 /sys/test/test.txt | |
| parent | f59a9cb554a8dfcbe13c8a0775542ee7a0d8a353 (diff) | |
pkg/compiler: add offsetof type
Similar to C offsetof gives offset of a field
from the beginning of the parent struct.
We have several TODOs in descriptions asking for this.
Diffstat (limited to 'sys/test/test.txt')
| -rw-r--r-- | sys/test/test.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/test/test.txt b/sys/test/test.txt index 1ddc67aa8..a087dd47f 100644 --- a/sys/test/test.txt +++ b/sys/test/test.txt @@ -461,6 +461,27 @@ len_expr4 { test$length30(a0 ptr[in, len_expr1], a1 bytesize[a0:f11], a2 ptr[in, bytesize[a0:f11:f21, int32]], a3 bytesize[a0:f11:f21:f31]) +test$offsetof0(a0 ptr[in, offsetof0]) + +offsetof0 { + f0 int32 + f1 int8 + f2 int16 + f3 int8 + f4 int64 + f5 int32:5 + f6 int32:10 + f7 int64 + o0 offsetof[f0, int32] + o1 offsetof[f1, int32] + o2 offsetof[f2, int32] + o3 offsetof[f3, int32] + o4 offsetof[f4, int32] + o5 offsetof[f5, int32] + o6 offsetof[f6, int32] + o7 offsetof[f7, int32] +} + # Big endian test$end0(a0 ptr[in, syz_end_int_struct]) |
