From: Paul Floyd Date: Mon, 7 Oct 2024 05:34:59 +0000 (+0200) Subject: FreeBSD regtest: add FAKE macros for scalar X-Git-Tag: VALGRIND_3_24_0~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4077a7afd80badf657024040b6052c346320acb;p=thirdparty%2Fvalgrind.git 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 --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index c76db8ecd..698df7c12 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 b560a7f53..ddc0c79c2 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;