summaryrefslogtreecommitdiffstats
path: root/tests/array-types
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-05 20:10:48 +0100
committerMattias Andrée <maandree@kth.se>2023-12-05 20:10:48 +0100
commit6d77b155bcd4725e09837604e6ea86f5f124ba9c (patch)
tree7cfdf466bb94bbbe3e7929432bc048da5eaa2349 /tests/array-types
parentSecond commit (diff)
downloadlibsyscalls-6d77b155bcd4725e09837604e6ea86f5f124ba9c.tar.gz
libsyscalls-6d77b155bcd4725e09837604e6ea86f5f124ba9c.tar.bz2
libsyscalls-6d77b155bcd4725e09837604e6ea86f5f124ba9c.tar.xz
Third commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'tests/array-types')
-rw-r--r--tests/array-types33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/array-types b/tests/array-types
new file mode 100644
index 0000000..5bb0429
--- /dev/null
+++ b/tests/array-types
@@ -0,0 +1,33 @@
+# -*- sh -*-
+# See LICENSE file for copyright and license details.
+
+patypes="$(printf '%s\n' "$types" | cut -d ' ' -f 2 | grep -v '\(STRUCT\|UNION\)' | sed -n 's/_ARRAY$//p')"
+test -n "$patypes"
+for os in $(getnamelist OS); do
+ osn=$(getnum OS $os)
+ for arch in $(getnamelist ARCH); do
+ archn=$(getnum ARCH $arch)
+ if ! issupported $os $arch; then
+ continue
+ fi
+
+ for ptype in $patypes CHAR; do
+ atype="${ptype}_ARRAY"
+ if test $atype = CHAR_ARRAY; then
+ atype=BUFFER
+ fi
+ auftype="${atype}_UNKNOWN_FILL"
+
+ get-datatype-description.tu $osn $archn $(lookupnum "$types" $ptype) $os $arch $ptype \
+ | sed 's/^\(array_size\) = 1$/\1 = 0/' \
+ | sed 's/^\(fill_is_known\) = .*$/\1 = 1/' \
+ | sed 's/^\(relative_position_of_array_size\) = .*$/\1 = 1/' \
+ | sed 's/^\(absolute_position_of_array_size\) = .*$/\1 = -1/' > $a
+ get-datatype-description.tu $osn $archn $(lookupnum "$types" $atype) $os $arch $atype > $b
+ diff -u $a $b
+
+ get-datatype-description.tu $osn $archn $(lookupnum "$types" $auftype) $os $arch $auftype > $b
+ sed 's/^\(fill_is_known\) = .*$/\1 = 0/' < $a | diff -u - $b
+ done
+ done
+done