123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #include <stdio.h>
- #include <stdlib.h>
- #define PageSize 4096
- #define NumPages 512
- int sparse[NumPages][PageSize];
- int
- main()
- {
- int i,j;
- printf("Entering the huge program - I will stress test your VM\n");
-
- for (i=0; i<NumPages; i++) {
- sparse[i][0]=i;
- }
-
- printf("stage [1] done\n");
-
-
- for (j=0; j<5; j++) {
- for (i=0; i<NumPages; i++) {
- sparse[i][0]++;
- }
- printf("stage [2.%d] done\n", j);
- }
-
- printf("stage [2] done\n");
-
-
- for (i=NumPages-1; i>=0; i--) {
- if (sparse[i][0]!=i+5) {
- printf("BAD NEWS!!! - your VM mechanism has a bug!\n");
- exit(1);
- }
- }
-
- printf("You passed!\n");
-
- return 0;
- }
|