3 #include "mutatee_util.h"
5 /* Externally accessed function prototypes. These must have globally unique
6 * names. I suggest following the pattern <testname>_<function>
13 /* Global variables accessed by the mutator. These must have globally unique
17 unsigned int test4_2_global1 = 0xdeadbeef;
19 /* Internally used function prototypes. These should be declared with the
20 * keyword static so they don't interfere with other mutatees in the group.
23 /* Global variables used internally by the mutatee. These should be declared
24 * with the keyword static so they don't interfere with other mutatees in the
28 /* Function definitions follow */
30 /* should be called by parent */
31 void test4_2_func3() {
32 dprintf("pid %d in test4_2_func3\n", (int) getpid());
33 test4_2_global1 = 2000002;
36 /* should be called by child */
37 void test4_2_func4() {
38 dprintf("pid %d in test4_2_func4\n", (int) getpid());
39 test4_2_global1 = 2000003;
42 void test4_2_func2() {
43 /* if we get this value at exit, no function was called */
44 test4_2_global1 = 2000001;
47 int test4_2_mutatee() {
48 #ifndef os_windows_test
52 dprintf("fork result: %d\n", pid);
55 registerPID(pid); /* Register for cleanup */
59 /* both parent and child exit here */
61 dprintf("at exit of %d, test4_2_global1 = %d\n", (int) getpid(),
64 #if defined(rs6000_ibm_aix4_1_test)
66 /* On AIX the child dies when the parent exits, so wait */
67 /* apparently the parent needs to wake up occasionally to keep Dyninst happy */
68 dprintf("%d SLEEPING\n",getpid());
70 dprintf("%d SLEEP MORE\n",getpid());
72 dprintf("%d SLEEP MORE\n",getpid());
74 dprintf("%d DONE SLEEPING\n",getpid());
78 dprintf("Mutatee %d exiting...\n", getpid());
85 return 0; /* No error, technically. Shouldn't get here */