This test checks for amd64 or mips. For amd64 it uses syscall 64.
That is 'exit' on Linux, 'umask' on both FreeBSD and Solaris
(which seems to work by accident). On Darwin it isn't a valid
syscall number which causes a Valgrind error.
Now Darwin uses syscall 0x02000001 (exit) and the test passes.
"dec %%eax\n\t"
"cmp $0x0,%%eax\n\t"
"jne top\n\t"
- "mov $60, %%eax\n\t"
+#if defined(__APPLE__)
+ "mov $0x02000001, %%eax\n\t" /* macOS exit */
+#else
+ "mov $60, %%eax\n\t" /* Linux exit, FreeBSD and Solaris umask. umask works by accident. */
+#endif
"mov $0, %%rdi\n\t"
"syscall\n\t"
: : : "eax", "ebx", "rdi"