mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:51:15 +08:00
1368b914e9
Now that all port tests live under testsuite/sim/*/, and none live in testsuite/ directly, flatten the structure by moving all of the dirs under testsuite/sim/ to testsuite/ directly. We need to stop passing --tool to dejagnu so that it searches all dirs and not just ones that start with "sim". Since we have no other dirs in this tree, and no plans to add any, should be fine.
32 lines
785 B
C
32 lines
785 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
/* Sanity check that system calls for realloc works. Also tests a few
|
|
more cases for mmap2 and munmap. */
|
|
|
|
int main ()
|
|
{
|
|
void *p1, *p2;
|
|
|
|
if ((p1 = malloc (8100)) == NULL
|
|
|| (p1 = realloc (p1, 16300)) == NULL
|
|
|| (p1 = realloc (p1, 4000)) == NULL
|
|
|| (p1 = realloc (p1, 500)) == NULL
|
|
|| (p1 = realloc (p1, 1023*1024)) == NULL
|
|
|| (p1 = realloc (p1, 8191*1024)) == NULL
|
|
|| (p1 = realloc (p1, 512*1024)) == NULL
|
|
|| (p2 = malloc (1023*1024)) == NULL
|
|
|| (p1 = realloc (p1, 1023*1024)) == NULL
|
|
|| (p1 = realloc (p1, 8191*1024)) == NULL
|
|
|| (p1 = realloc (p1, 512*1024)) == NULL)
|
|
{
|
|
printf ("fail\n");
|
|
exit (1);
|
|
}
|
|
|
|
free (p1);
|
|
free (p2);
|
|
printf ("pass\n");
|
|
exit (0);
|
|
}
|