]> git.ipfire.org Git - thirdparty/gcc.git/blob - libvtv/testsuite/register_pair.cc
0759c472df15f384e2c152293cc59164dae37b31
[thirdparty/gcc.git] / libvtv / testsuite / register_pair.cc
1 #include "vtv_utils.h"
2 #include "vtv_rts.h"
3
4 /* This configuration will test mostly inserting of elements that are already inserted since
5 the number of repeats is 200 */
6
7 #define NUM_MAPS 4000
8 #define ELEMENTS_PER_MAP 100
9 #define NUM_REPEATS 200
10
11 /* This variable has to be put in rel.ro */
12 void * maps[NUM_MAPS] VTV_PROTECTED_VAR;
13
14 struct fake_vt {
15 void * fake_vfp [4];
16 };
17 void * fake_vts [NUM_MAPS * ELEMENTS_PER_MAP];
18
19 int main()
20 {
21 __VLTChangePermission(__VLTP_READ_WRITE);
22
23 for (int k = 0; k < NUM_REPEATS; k++)
24 {
25 int curr_fake_vt = 0;
26 for (int i = 0; i < NUM_MAPS; i++)
27 for (int j = 0; j < ELEMENTS_PER_MAP; j++)
28 {
29 #ifdef VTV_DEBUG
30 __VLTRegisterPairDebug(&maps[i], &fake_vts[curr_fake_vt]);
31 #endif
32 curr_fake_vt++;
33 }
34 }
35
36 __VLTChangePermission(__VLTP_READ_ONLY);
37
38 return 0;
39 }