From 6d77b155bcd4725e09837604e6ea86f5f124ba9c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 5 Dec 2023 20:10:48 +0100 Subject: Third commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- linux/tests/os-dependent-arrays | 17 +++++++++++++++++ linux/tests/os-dependent-primitives | 23 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 linux/tests/os-dependent-arrays create mode 100644 linux/tests/os-dependent-primitives (limited to 'linux/tests') diff --git a/linux/tests/os-dependent-arrays b/linux/tests/os-dependent-arrays new file mode 100644 index 0000000..3140ce4 --- /dev/null +++ b/linux/tests/os-dependent-arrays @@ -0,0 +1,17 @@ +# -*- sh -*- +# See LICENSE file for copyright and license details. + +for arch in $(getnamelist ARCH); do + archn=$(getnum ARCH $arch) + if ! issupported $os $arch; then + continue + fi + + ptype=ULONG + atype=FD_SET + get-datatype-description.tu $osn $archn $(lookupnum "$types" $ptype) $os $arch $ptype > $a + get-datatype-description.tu $osn $archn $(lookupnum "$types" $atype) $os $arch $atype > $b + sed 's/^\(array_size\) = 1$/\1 = '"$(( 1024 / $(sed -n 's/^width_in_bits = //p' < $a) ))"/ < $a \ + | sed 's/^\(is_unsigned\) = 1/\1 = 0/' \ + | diff -u - $b +done diff --git a/linux/tests/os-dependent-primitives b/linux/tests/os-dependent-primitives new file mode 100644 index 0000000..bc20bf3 --- /dev/null +++ b/linux/tests/os-dependent-primitives @@ -0,0 +1,23 @@ +# -*- sh -*- +# See LICENSE file for copyright and license details. + +for arch in $(getnamelist ARCH); do + archn=$(getnum ARCH $arch) + if ! issupported $os $arch; then + continue + fi + + typeisas SCHAR INT8 + typeisas SHORT INT16 + typeisas INT INT32 + typeisas LONG INTPTR + typeisas LLONG INT64 + + get-datatype-description.tu $osn $archn $(lookupnum "$types" LONG) $os $arch LONG \ + | sed 's/^\(is_unsigned\) = 0$/\1 = 1/' \ + | sed 's/^\(sign_representation\) = .*$/\1 = '"$(getnum SIGN UNDETERMINED)"/ \ + | sed 's/^\(annotation\) = .*$/\1 = '"$(getnum ANNOTATION UNDETERMINED)"/ \ + | sed 's/^\(section\) = .*$/\1 = '"$(getnum SECTION UNDETERMINED)"/ > $a + get-datatype-description.tu $osn $archn $(lookupnum "$types" DYNAMIC) $os $arch DYNAMIC > $b + diff -u $a $b +done -- cgit v1.2.3-70-g09d2