20 int main(int argc
, char *argv
[]);
30 if (argc
== 2) m
= atoi(argv
[1]);
34 for (i
= 0; i
< 70; i
++) {
35 if (m
& 00001) test6a();
36 if (m
& 00002) test6b();
40 return(-1); /* impossible */
45 /* Test sbrk() and brk(). */
47 char *addr
, *addr2
, *addr3
;
48 int i
, del
, click
, click2
;
52 addr
= sbrk(0); /* force break to a click boundary */
53 for (i
= 0; i
< 10; i
++) sbrk(7 * i
);
54 for (i
= 0; i
< 10; i
++) sbrk(-7 * i
);
55 if (sbrk(0) != addr
) e(1);
57 if (brk(addr
) != 0) e(2);
58 if (sbrk(0) != addr
) e(3);
65 } while (addr2
== addr
);
68 if (sbrk(0) != addr
) e(4);
70 if (sbrk(0) != addr
) e(5);
77 } while (addr3
== addr
);
78 click2
= addr
- addr3
;
80 if (sbrk(0) != addr
) e(6);
82 if (sbrk(0) != addr
) e(8);
83 if (click
!= click2
) e(9);
85 brk(addr
+ 2 * click
);
86 if (sbrk(0) != addr
+ 2 * click
) e(10);
88 if (sbrk(0) != addr
+ 5 * click
) e(11);
90 if (sbrk(0) != addr
) e(12);
98 signal(SIGQUIT
, SIG_IGN
);
100 for (i
= 0; i
< 5000; i
++)
101 if (zilch
[i
] != 0) err
++;
103 kill(getpid(), SIGQUIT
);