]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD regtest: add FAKE macros for scalar
authorPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 7 Oct 2024 05:34:59 +0000 (07:34 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 7 Oct 2024 05:34:59 +0000 (07:34 +0200)
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.

memcheck/tests/freebsd/scalar.c
memcheck/tests/freebsd/scalar.h

index c76db8ecdb7fecbbaa5041f889ac868439808467..698df7c12d0e2ee718e550829d7c2e040586f336 100644 (file)
@@ -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 */
index b560a7f533259120d61edddeb0a652c44880b260..ddc0c79c2b69e82bba06786c312cca51e4a11b8b 100644 (file)
       } \
    } 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;