https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a4077a7afd80badf657024040b6052c346320acb
commit a4077a7afd80badf657024040b6052c346320acb
Author: Paul Floyd <pj...@wa...>
Date: Mon Oct 7 07:34:59 2024 +0200
FreeBSD regtest: add FAKE macros for scalar
FreeBSD 15 removed the never-implemented sbrk syscall.
Arm64 also has a few missing syscalls (backward compat ones
that predate the arm64 port). Rather than having an ever
increasing number of expecteds the aim is to use these
FAKE macros. It's a bit fiddly to get the matching text.
Diff:
---
memcheck/tests/freebsd/scalar.c | 7 ++++++-
memcheck/tests/freebsd/scalar.h | 9 +++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c
index c76db8ecdb..698df7c12d 100644
--- a/memcheck/tests/freebsd/scalar.c
+++ b/memcheck/tests/freebsd/scalar.c
@@ -309,10 +309,15 @@ int main(void)
/* obsol vwrite 68 */
-#if defined(SYS_sbrk)
/* SYS_sbrk 69 */
+#if defined(SYS_sbrk)
GO(SYS_sbrk, "1s 1m");
SY(SYS_sbrk, x0); FAIL;
+#else
+ FAKE_GO("69: SYS_sbrk 1s 1m");
+ FAKE_SY("Syscall param sbrk(incr) contains uninitialised byte(s)\n")
+ FAKE_SY(" ...\n");
+ FAKE_SY("\n");
#endif
/* not implemented on OS SYS_sstk 70 */
diff --git a/memcheck/tests/freebsd/scalar.h b/memcheck/tests/freebsd/scalar.h
index b560a7f533..ddc0c79c2b 100644
--- a/memcheck/tests/freebsd/scalar.h
+++ b/memcheck/tests/freebsd/scalar.h
@@ -33,6 +33,15 @@
} \
} while (0);
+#define FAKE_GO(str) \
+ fprintf(stderr, "---------------------------------------------------------\n" \
+ " %s\n" \
+ "---------------------------------------------------------\n", \
+ str);
+
+#define FAKE_SY(msg) \
+ fprintf(stderr, "%s", (msg));
+
/* Module variables. */
static long x0;
static long res;
|