Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / arm64-linux / scalar.h
blob8ef050f4b071344cf2cbbf43cb905577b57e879d
1 /* This is the arm64 variant of memcheck/tests/x86-linux/scalar.h */
2 #include "../../../include/vki/vki-scnums-arm64-linux.h"
4 #include <assert.h>
5 #include <errno.h>
6 #include <fcntl.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <sys/syscall.h>
10 #include <sys/stat.h>
11 #include <sys/ptrace.h>
12 #include <sys/types.h>
13 #include <sys/mman.h>
15 #ifndef __THROW
16 #define __THROW
17 #endif
19 // Since we use vki_unistd.h, we can't include <unistd.h>. So we have to
20 // declare this ourselves.
21 extern long int syscall (long int __sysno, ...) __THROW;
23 // Thorough syscall scalar arg checking. Also serves as thorough checking
24 // for (very) basic syscall use. Generally not trying to do anything
25 // meaningful with the syscalls.
27 #define GO(__NR_xxx, s) \
28 fprintf(stderr, "-----------------------------------------------------\n" \
29 "%3d:%20s %s\n" \
30 "-----------------------------------------------------\n", \
31 __NR_xxx, #__NR_xxx, s);
33 #define SY res = syscall
35 #define FAIL assert(-1 == res);
36 #define SUCC assert(-1 != res);
37 #define SUCC_OR_FAIL /* no test */
39 #define FAILx(E) \
40 do { \
41 int myerrno = errno; \
42 if (-1 == res) { \
43 if (E == myerrno) { \
44 /* as expected */ \
45 } else { \
46 fprintf(stderr, "Expected error %s (%d), got %d\n", #E, E, myerrno); \
47 exit(1); \
48 } \
49 } else { \
50 fprintf(stderr, "Expected error %s (%d), got success\n", #E, E); \
51 exit(1); \
52 } \
53 } while (0);
55 #define SUCC_OR_FAILx(E) \
56 do { \
57 int myerrno = errno; \
58 if (-1 == res) { \
59 if (E == myerrno) { \
60 /* as expected */ \
61 } else { \
62 fprintf(stderr, "Expected error %s (%d), got %d\n", #E, E, myerrno); \
63 exit(1); \
64 } \
65 } \
66 } while (0);