1 /* Test globals used and unused within different parts of a program */
5 extern void exit_dummy(int*);
11 foo(int *Z) /* accesses globals printf and format string, and */
12 { /* N = alloca(int) from test() */
13 if (Z == 0) exit_dummy(Z); /* call to external function */
15 printf("N = %d\n", *Z);
20 if (Y == 0) exit_dummy(Y); /* second call to external function */
24 test(int* X) /* accesses global G */
25 { /* allocates G = malloc(int*) and N = alloca(int) */
28 G = (int**) alloca(sizeof(int*));
38 main() /* only accesses global N */