summaryrefslogtreecommitdiffstats
path: root/tests/array-types
diff options
context:
space:
mode:
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