1 /* FIXME: this testcase should be automated! */
5 typedef struct Tree_struct {
7 struct Tree_struct *left, *right;
10 static Tree T1, T2, T3, T4, T5, T6, T7;
11 static Tree *Root, *ANode;
14 /* forces *Tb->right to be collapsed */
15 void makeMore(Tree* Ta, Tree* Tb)
20 /* Tb->right = &T5; */
21 Tb->right = (Tree*) (((char*) &T5) + 5); /* point to fifth byte of T5 */
24 /* multiple calls to this should force globals to be merged in TD graph
25 * but not in globals graph
27 void makeData(Tree* Ta)
39 /* BU graph shows T1.left->{T2}, but TD graph should show T1.left->{T1,T2,T6,H}
40 * and T.right->{T1,T2,T6,H} */
47 * T2.right->{H}, H.left->{T6}; H.right->{T2}, T3.left<->T7.left
49 * TD graph and GlobalsGraph should show:
50 * T2.right->{T1,T2,T6,H}
51 * H.left->{T1,T2,T6,H}; H.right->{T1,T2,T6,H}.
52 * T3.left->{T4,T7}, T3.right->{T4,T7}, T7.left->{T3}
56 Tree* newT = (Tree*) malloc(sizeof(Tree));
57 T2.right = newT; /* leaked: do not access T2 in main */
65 /* BU and TD graphs should have no reachable globals, forcing callers and
66 * callees to get all globals from GlobalsGraph
81 printf("T3.data = %d\n", T3.data);