Add uncommitted tests and curiosities

This commit is contained in:
Théophile Bastian 2019-04-05 16:39:21 +02:00
parent 11fa3fab40
commit 6df057260d
6 changed files with 2843 additions and 0 deletions

1
csmith/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
0[0-9]/

1
curiosities/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.bin

File diff suppressed because it is too large Load diff

1
test/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.bin

19
test/inline_asm.c Normal file
View file

@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
if(argc < 2) {
fprintf(stderr, "Missing argument: loop upper bound.\n");
exit(1);
}
int upper_bound = atoi(argv[1]);
int count = 0;
for(int i=0; i < upper_bound; ++i) {
__asm__("sub $8, %rsp; movq $42, (%rsp)");
count++;
__asm__("add $8, %rsp");
}
printf("%d\n", count);
return 0;
}

28
test/without_rbp_col.c Normal file
View file

@ -0,0 +1,28 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
void rbp_bump_2(int z) {
for(int cz=1; cz < z; cz++) {
int x[cz];
x[cz / 2] = 8;
}
}
void rbp_bump_1(int y) {
for(int cy=1; cy < y; cy++) {
int x[cy];
x[cy / 2] = 8;
rbp_bump_2(x[cy/2]);
}
}
int main(int argc, char** argv) {
if(argc < 2) {
fprintf(stderr, "Missing argument: n\n");
return 1;
}
int num = atoi(argv[1]);
rbp_bump_1(num);
return 0;
}