mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
New test file
This commit is contained in:
parent
536fa42f64
commit
e4ba8d75c2
2 changed files with 33 additions and 1 deletions
|
@ -1,10 +1,13 @@
|
|||
OPT=-g
|
||||
#OPT=-O2
|
||||
|
||||
test-args: test-args.c
|
||||
cc -O2 test-args.c -o test-args
|
||||
|
||||
fac-test: fac-test.c
|
||||
cc fac-test.c $(OPT) -fPIC -Wall -I/usr/local/include -L/usr/local/lib -Wl,--export-dynamic -c -o fac-test.o
|
||||
cc fac-test.o /usr/local/share/cyclone/scheme/cyclone/common.o /usr/local/share/cyclone/scheme/base.o /usr/local/share/cyclone/scheme/write.o -pthread -lcyclone -lck -lm -ltommath -ldl $(OPT) -fPIC -Wall -I/usr/local/include -L/usr/local/lib -Wl,--export-dynamic -o fac-test
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f *.o fac-test
|
||||
rm -f *.o fac-test test-args
|
||||
|
|
29
tests/experimental/test-args.c
Normal file
29
tests/experimental/test-args.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int *buf;
|
||||
int fglo() {
|
||||
return buf[0] + buf[1] + buf[2];
|
||||
}
|
||||
int fargs(int x, int y, int z) {
|
||||
return x + y + z;
|
||||
}
|
||||
|
||||
void main() {
|
||||
buf = calloc(sizeof(int), 3);
|
||||
long long sum = 0;
|
||||
int MAX = 1 * 1000;
|
||||
|
||||
for (int a = 0; a < MAX; a++) {
|
||||
for (int b = 0; b < MAX; b++) {
|
||||
for (int c = 0; c < MAX; c++) {
|
||||
buf[0] = a;
|
||||
buf[1] = b;
|
||||
buf[2] = c;
|
||||
sum += fglo();
|
||||
//sum += fargs(a, b, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%ld\n", sum);
|
||||
}
|
Loading…
Add table
Reference in a new issue