/memcheck/tests/x86-freebsd/posix_fadvise
/memcheck/tests/x86-freebsd/posix_fallocate
/memcheck/tests/x86-freebsd/reallocarray
+/memcheck/tests/x86-freebsd/scalar_arg_check
# /memcheck/tests/arm64-freebsd
/memcheck/tests/arm64-freebsd/*.stderr.diff
include $(top_srcdir)/Makefile.tool-tests.am
-dist_noinst_SCRIPTS = filter_stderr
+dist_noinst_SCRIPTS = filter_stderr filter_arg_check
EXTRA_DIST = \
posix_fadvise.vgtest \
posix_fadvise.stderr.exp \
posix_fallocate.stderr.exp \
reallocarray.vgtest \
- reallocarray.stderr.exp
+ reallocarray.stderr.exp \
+ scalar_arg_check.vgtest \
+ scalar_arg_check.stderr.exp
check_PROGRAMS = \
- posix_fadvise posix_fallocate reallocarray
+ posix_fadvise posix_fallocate reallocarray scalar_arg_check
# Linux also adds $(FLAG_MMMX) $(FLAG_MSSE) to the first two
AM_CFLAGS += @FLAG_M32@
--- /dev/null
+#! /bin/sh
+
+# Only one test uses this which calls syscall(SYS_sendfile)
+# which is the only x86 syscall that uses 8 arguments
+# The output includes --trace-syscalls=yes which is very verbose
+# but we only want to see the sendfile line
+
+# the libc signature for sendfile is
+# int sendfile(int fd, int s, off_t offset, size_t nbytes,
+# struct sf_hdtr *hdtr, off_t *sbytes, int flags);
+# The testcase uses values from 101 to 108 for the arguments
+# (to make it easy to match the testcase to the log output)
+# Some of the arguments are printed as hex, not too bad.
+# Argument 3 is a 64bit value made up from the 32bit arguments
+# 3 and 4 resulting in 7 values in the expected.
+
+grep "SYSCALL.*sendfile" |
+sed 's/==.*//' |
+sed -E 's/\[[0-9]{5}/[xxxxx/'
+
--- /dev/null
+#include "../freebsd/scalar.h"
+
+int main(void)
+{
+ /* sendfile uses 8 args */
+ SY(SYS_sendfile, 101, 102, 103, 104, 105, 106, 107, 108);
+}
+
--- /dev/null
+SYSCALL[xxxxx,1](393) sys_sendfile ( 101, 102, 446676598887, 105, 0x6a, 0x6b, 108 )
--- /dev/null
+../amd64-freebsd/scalar_arg_check.vgtest
\ No newline at end of file