From 56d01184e3b69688dec04bd97a3017df9462f4fc Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Sat, 4 Jul 2020 13:54:43 +0200 Subject: executor: fix bitfields for big-endian arch Add bitfield tests for big-endian arch Issue: #1885 Signed-off-by: Alexander Egorenkov --- sys/test/test/bf2_be | 25 +++++++++++++++++++++++++ sys/test/test/bf_be | 6 ++++++ 2 files changed, 31 insertions(+) create mode 100644 sys/test/test/bf2_be create mode 100644 sys/test/test/bf_be (limited to 'sys/test') diff --git a/sys/test/test/bf2_be b/sys/test/test/bf2_be new file mode 100644 index 000000000..094c3f6e2 --- /dev/null +++ b/sys/test/test/bf2_be @@ -0,0 +1,25 @@ +# 32_shmem has 4-byte alignment for int64 and everything goes havoc. +# requires: -arch=32_shmem -littleendian + +syz_compare(&AUTO="1200000034607800", AUTO, &AUTO=@bf4={0x12, {0x34, 0x56, 0x78}}, AUTO) +syz_compare(&AUTO="1200000034600000", AUTO, &AUTO=@bf5={0x12, {0x34, 0x56}}, AUTO) +syz_compare(&AUTO="120034607800", AUTO, &AUTO=@bf6={0x12, {0x34, 0x56, 0x78}}, AUTO) +syz_compare(&AUTO="12003460", AUTO, &AUTO=@bf7={0x12, {0x34, 0x56}}, AUTO) +syz_compare(&AUTO="1200000034680000", AUTO, &AUTO=@bf8={0x12, {0x34, 0x56, 0x78}}, AUTO) +syz_compare(&AUTO="12003468", AUTO, &AUTO=@bf9={0x12, {0x34, 0x56, 0x78}}, AUTO) +syz_compare(&AUTO="120000000000000034567890abcdef102340ab0000000000", AUTO, &AUTO=@bf10={0x12, {0x3, 0x4, 0x5, 0x678, 0x90a, 0xbcd, 0xef1, 0x234, 0xab}}, AUTO) +syz_compare(&AUTO="120000003456789a", AUTO, &AUTO=@bf11={0x12, {0x34, 0x56, 0x78, 0x9, 0xa}}, AUTO) +syz_compare(&AUTO="120000003456789ab0cd0000", AUTO, &AUTO=@bf12={0x12, {0x34, 0x56, 0x78, 0x9, 0xa, 0xb, 0xcd}}, AUTO) +syz_compare(&AUTO="1200000034567890abc00000", AUTO, &AUTO=@bf13={0x12, {0x3456, 0x789, 0xabc}}, AUTO) +syz_compare(&AUTO="1200000034567890", AUTO, &AUTO=@bf14={0x12, {0x34, 0x56, 0x789}}, AUTO) +syz_compare(&AUTO="1200000034567800", AUTO, &AUTO=@bf15={0x12, {0x34, 0x567, 0x8}}, AUTO) +syz_compare(&AUTO="1200000034560000", AUTO, &AUTO=@bf16={0x12, {0x34, 0x5, 0x6}}, AUTO) +syz_compare(&AUTO="1200000034146000", AUTO, &AUTO=@bf17={0x12, {0x34, 0x5, 0x6}}, AUTO) +syz_compare(&AUTO="1200000034501800", AUTO, &AUTO=@bf18={0x12, {0x34, 0x5, 0x6}}, AUTO) +syz_compare(&AUTO="120034005670", AUTO, &AUTO=@bf19={0x12, {0x34, 0x567}}, AUTO) +syz_compare(&AUTO="12000000000000003456789a00000000", AUTO, &AUTO=@bf20={0x12, {0x34, 0x56, 0x7, 0x8, 0x9, 0xa}}, AUTO) +syz_compare(&AUTO="1200000033333333456789ab", AUTO, &AUTO=@bf21={0x12, {0x33333333, 0x45, 0x67, 0x89ab}}, AUTO) +syz_compare(&AUTO="123456", AUTO, &AUTO=@bf22={0x12, {0x34, 0x5, 0x6}}, AUTO) +syz_compare(&AUTO="12345d80", AUTO, &AUTO=@bf23={0x12, {0x34, 0x5, 0x36}}, AUTO) +syz_compare(&AUTO="123450", AUTO, &AUTO=@bf24={0x12, {0x34, 0x5}}, AUTO) +syz_compare(&AUTO="1200000000aa02efbbcc0000", AUTO, &AUTO=@bf25={0x12, {0xaa, 0xbb, 0x1, 0x1, 0xbbcc, ''}}, AUTO) diff --git a/sys/test/test/bf_be b/sys/test/test/bf_be new file mode 100644 index 000000000..4c7fc85ec --- /dev/null +++ b/sys/test/test/bf_be @@ -0,0 +1,6 @@ +# 32_shmem has 4-byte alignment for int64 and everything goes havoc. +# requires: -arch=32_shmem -littleendian + +syz_compare(&AUTO="eac0000000000000cdcdcdcdcdcdcdcd5fffffc075607560aa", 0x20, &AUTO=@bf0={0xabab, 0xcdcdcdcdcdcdcdcd, 0xabab, 0xffff, 0xffffff, 0xabab, 0xabab, 0xaaa}, AUTO) +syz_compare(&AUTO="ccddef23456ef120", 0x8, &AUTO=@bf2={0x0abc, 0x0bcd, 0xcdef, 0x123456, 0x78ef12}, AUTO) +syz_compare(&AUTO="ccddef23456ef120", 0x8, &AUTO=@bf3={0x0abc, 0x0bcd, 0xcdef, 0x123456, 0x78ef12}, AUTO) -- cgit mrf-deployment