1 /* Test resolvable and unresolvable calls through function pointers:
2 * -- both should be retained in function graphs until resolved or until main
3 * -- former should get resolved in or before main() and never appear in GG
4 * -- latter should remain unresolved in main() and copied to GG
5 * -- globals in GG pointed to by latter should be marked I, but not other nodes
10 extern void exit_dummy(int*);
14 void makeCalls(void(*GpKnown)(int*), void(*GpUnknown)(int*))
16 if (Z == 0) GpUnknown(&X); /* pass to exit_dummy: never resolved */
17 else GpKnown(&M); /* pass to knownF: resolved in main*/
19 printf("&Z = %p\n", &Z); /* "known external": resolved here */
24 if (Y == 0) knownF(Y); /* direct call to self: resolved here */
27 int main(int argc, char** argv)
29 void(*GpKnown)(int*) = knownF;
30 void(*GpUnknown)(int*) = exit_dummy;
32 makeCalls(GpKnown, GpUnknown);