fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / libgloss / testsuite / libgloss.all / memory.c
blob6e0422d3d2c5b9ce857c09027174eaa3625a8146
1 /* WinBond bug report
3 malloc() returns 0x0.
5 test the memory calls. These test sbrk(), which is part of glue.c
6 for most architectures.
7 */
9 #include <stdio.h>
10 #define BUFSIZE 80
12 main()
14 char *buf;
15 char *tmp;
16 char *result;
18 /* see if we can get some memory */
19 buf = (char *)malloc(BUFSIZE);
20 if (buf != 0x0) {
21 pass ("malloc");
22 } else {
23 fail ("malloc");
26 /* see if we can realloc it */
27 tmp = buf;
28 result = (char *)realloc (buf, BUFSIZE+100);
29 if ((buf != 0x0) && (result != 0x0)) {
30 pass ("realloc");
31 } else {
32 fail ("realloc");
35 /* see if we can free it up. FIXME: how to test free ?*/
36 free (buf);
37 fflush (stdout);