xen: Infratructure for XEN_TMEM_* hypercalls
[valgrind.git] / memcheck / tests / badrw.c
blobd711ec969b771c4795f0580bfe29e2cf43fd3bfb
1 #include <stdlib.h>
3 int main(void)
5 void* x = malloc(10);
7 int *x4;
8 short *x2;
9 char *x1;
10 int y4;
11 short y2;
12 char y1;
14 x4 = x-4;
15 x2 = x-4;
16 x1 = x-1;
18 // Invalid reads and writes of sizes 4, 2, 1
19 y4 = *x4;
20 *x4 = y4;
22 y2 = *x2;
23 *x2 = y2;
25 y1 = *x1;
26 *x1 = y1;
28 return 0;