This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <config.h>
18
19 #include "resource-ext.h"
20
21 #include <stdio.h>
22 #include <stdlib.h>
23
24 #include "qemu.h"
25 #include "macros.h"
26
27 void *memchunk1;
28 void *memchunk2;
29
30 int
31 main ()
32 {
33 uintptr_t value1, value2, value3;
34
35 value1 = get_rusage_data ();
36
37 memchunk1 = malloc (0x88);
38
39 value2 = get_rusage_data ();
40
41 memchunk2 = malloc (0x281237);
42
43 value3 = get_rusage_data ();
44
45 if (value1 == 0 && value2 == 0 && value3 == 0)
46 {
47 fprintf (stderr, "Skipping test: no way to determine data segment size\n");
48 return 77;
49 }
50 else if (is_running_under_qemu_user ())
51 {
52 fprintf (stderr, "Skipping test: running under QEMU\n");
53 return 77;
54 }
55 else
56 {
57
58 ASSERT (value2 > 0);
59
60
61 ASSERT (value2 >= value1);
62 ASSERT (value3 >= value2);
63
64 #if !(__GLIBC__ == 2 || MUSL_LIBC || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__ || defined __OpenBSD__ || defined _WIN32 || defined __CYGWIN__)
65
66 ASSERT (value3 > value1);
67 #endif
68
69 return 0;
70 }
71 }