summaryrefslogtreecommitdiffstats
path: root/tests/syscall-ranges
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/syscall-ranges
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/syscall-ranges')
-rw-r--r--tests/syscall-ranges38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/syscall-ranges b/tests/syscall-ranges
new file mode 100644
index 0000000..e42679a
--- /dev/null
+++ b/tests/syscall-ranges
@@ -0,0 +1,38 @@
+# -*- sh -*-
+# See LICENSE file for copyright and license details.
+
+for os in $(getnamelist OS); do
+ osn=$(getnum OS $os)
+ for arch in $(getnamelist ARCH); do
+ archn=$(getnum ARCH $arch)
+ get-syscall-range.tu $osn $archn $os $arch > $a
+ min="$(sed -n 's/min: //p' < $a)"
+ max="$(sed -n 's/max: //p' < $a)"
+ test -n "$min"
+ test -n "$max"
+ if test $min = x || test $max = x; then
+ (! issupported $os $arch)
+ continue
+ fi
+ issupported $os $arch
+ done
+done
+check_range () {
+ if issupported $1 $2; then
+ osn=$(getnum OS $1)
+ archn=$(getnum ARCH $2)
+ get-syscall-range.tu $osn $archn $1 $2 > $a
+ min="$(sed -n 's/min: //p' < $a)"
+ max="$(sed -n 's/max: //p' < $a)"
+ test $min -le $3
+ test $max -ge $4
+ test -z "$5" || test $min -ge $5
+ fi
+}
+check_range LINUX AMD64 0 453 0
+check_range LINUX AMD64_X32 0 547 0
+check_range LINUX M68K 0 452 0
+check_range LINUX PARISC_32 0 452 0
+check_range LINUX PARISC_64 0 452 0
+check_range LINUX SPARC_32 0 452 0
+check_range LINUX I386 0 452 0