clang-format

This commit is contained in:
2024-09-10 13:03:02 -04:00
parent 53c617d779
commit d66450e427
381 changed files with 28864 additions and 34170 deletions

View File

@@ -40,45 +40,42 @@
#include <stdio.h>
#include <stdlib.h>
#define PageSize 4096
#define NumPages 512
#define PageSize 4096
#define NumPages 512
int sparse[NumPages][PageSize]; /* use only the first element in the row */
int sparse[NumPages][PageSize]; /* use only the first element in the row */
int
main(void)
{
int i,j;
int main(void) {
int i, j;
printf("Entering the huge program - I will stress test your VM\n");
printf("Entering the huge program - I will stress test your VM\n");
/* move number in so that sparse[i][0]=i */
for (i=0; i<NumPages; i++) {
sparse[i][0]=i;
}
/* move number in so that sparse[i][0]=i */
for (i = 0; i < NumPages; i++) {
sparse[i][0] = i;
}
printf("stage [1] done\n");
printf("stage [1] done\n");
/* increment each location 5 times */
for (j=0; j<5; j++) {
for (i=0; i<NumPages; i++) {
sparse[i][0]++;
}
printf("stage [2.%d] done\n", j);
}
/* increment each location 5 times */
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");
printf("stage [2] done\n");
/* check if the numbers are sane */
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);
}
}
/* check if the numbers are sane */
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");
printf("You passed!\n");
return 0;
return 0;
}