arm64 front end: add spec rules for {EQ,NE} after {LOGIC32,LOGIC64}.
[valgrind.git] / memcheck / tests / noisy_child.c
blob7e30e389494e981e759684a8b48039fc9f292912
2 #include <stdlib.h>
3 #include <sys/types.h>
4 #include <unistd.h>
5 #include <assert.h>
7 void do_child_badness ( char* p )
9 /* Free it a second time */
10 free(p);
13 void do_parent_badness ( char* p )
15 /* Do a write off the end */
16 p[10] = 42;
20 int main ( void )
22 pid_t child;
23 char* p = malloc(10); assert(p);
24 free(p);
26 /* parent does something bad */
27 p[5] = 22;
29 child = fork();
30 assert(child != -1); /* assert fork did not fail */
32 if (child == 0) {
33 /* I am the child */
34 do_child_badness(p);
35 } else {
36 /* I am the parent */
37 do_parent_badness(p);
40 return 0;